-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run borrowck tests on BIDs and emit tail-expr-drop-order lints for violations #134523
base: master
Are you sure you want to change the base?
Run borrowck tests on BIDs and emit tail-expr-drop-order lints for violations #134523
Conversation
beada15
to
054769b
Compare
compiler/rustc_borrowck/src/lib.rs
Outdated
@@ -994,6 +997,23 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> { | |||
} | |||
} | |||
|
|||
fn maybe_polonius_borrows_in_scope<'s>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this mention polonius at all? why isn't this just called borrows_in_scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's.
I am tucking the comment into this function, too.
@bors try |
…t-2, r=<try> Run borrowck tests on BIDs and emit tail-expr-drop-order lints for violations Fix rust-lang#132861 r? `@nikomatsakis` cc `@compiler-errors` This patch enlarges the scope where the `tail-expr-drop-order` lint applies, so that all locals involved in tail expressions are inspected. This is necessary to run borrow-checking to capture the cases where it used to compile under Edition 2021 but is not going to pass borrow-checking from Edition 2024 onwards. The way it works is to inspect each BID against the set of borrows that are still live. If the local involved in BID has a borrow index which happens to be live as well at the location of this BID statement, in the future this will be a borrow-checking violation. The lint will fire in this case.
I have prepared the following craterbot message.
Shall we double-check and give this a go afterwards? Big thanks! |
🔒 Error: you're not allowed to interact with this bot. 🔑 If you are a member of the Rust team and need access, add yourself to the whitelist. |
…-run, r=<try> Crater run for `tail-expr-drop-order` This is experiment for rust-lang#134523
☀️ Try build successful - checks-actions |
A perf run shouldn't show anything since this shouldn't be enabled by default. However, some of these previous PRs have been unexpected regressions, let's check. @rust-timer build 9b5e8b1 |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (9b5e8b1): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 769.451s -> 768.407s (-0.14%) |
@craterbot run start=master#11663cd3bfefef7d34e8f0892c250bf698049392+rustflags=-Dtail-expr-drop-order end=try#9b5e8b16bd1c4acf4cf8e6880368314cf021a987+rustflags=-Dtail-expr-drop-order mode=build-only |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
I ran https://github.com/Skgland/Crater-Analysis to classify the 31091 contain 85 failures appear to be due to running out of disk space, Full report
|
0a77622
to
2daeb51
Compare
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
I ran https://github.com/Skgland/Crater-Analysis to classify the Mostly Cycle Detection Errors, some running out of disk space, two ices and some other problems. ICEs Others:
Full report
|
2daeb51
to
4749325
Compare
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@bors try |
…t-2, r=<try> Run borrowck tests on BIDs and emit tail-expr-drop-order lints for violations Fix rust-lang#132861 r? `@nikomatsakis` cc `@compiler-errors` This patch enlarges the scope where the `tail-expr-drop-order` lint applies, so that all locals involved in tail expressions are inspected. This is necessary to run borrow-checking to capture the cases where it used to compile under Edition 2021 but is not going to pass borrow-checking from Edition 2024 onwards. The way it works is to inspect each BID against the set of borrows that are still live. If the local involved in BID has a borrow index which happens to be live as well at the location of this BID statement, in the future this will be a borrow-checking violation. The lint will fire in this case.
⌛ Trying commit 4749325 with merge 214d5c94d03280918aa7845a8377fe60924de7b4... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
@craterbot run start=master#dcfa38fe234de9304169afc6638e81d0dd222c06+rustflags=-Dtail-expr-drop-order end=try#214d5c94d03280918aa7845a8377fe60924de7b4+rustflags=-Dtail-expr-drop-order mode=check-only |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
potential violations
Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
4749325
to
4072f44
Compare
I believe I've fixed the ICEs and the cycle errors, and I'll rerun crater on just the subset of failing crates. @craterbot crates=https://crater-reports.s3.amazonaws.com/pr-134523-1/retry-regressed-list.txt |
📝 Configuration of the ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
4072f44
to
a6c3f8e
Compare
…=chenyukang A few borrowck tweaks to improve 2024 edition migration lints See first two commits' changes to test outputs. Test coverage in this area is kinda weak, but I think it affects more cases than this (like the craters that will begin to trigger the `tail_expr_drop_order` tests in rust-lang#134523). Third commit is a drive-by change that removes a deref hack from `UseSpans` which doesn't really improve diagnostics much.
Fix #132861
r? @nikomatsakis
cc @compiler-errors
This patch enlarges the scope where the
tail-expr-drop-order
lint applies, so that all locals involved in tail expressions are inspected. This is necessary to run borrow-checking to capture the cases where it used to compile under Edition 2021 but is not going to pass borrow-checking from Edition 2024 onwards.The way it works is to inspect each BID against the set of borrows that are still live. If the local involved in BID has a borrow index which happens to be live as well at the location of this BID statement, in the future this will be a borrow-checking violation. The lint will fire in this case.