-
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
potential violations
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.
Co-authored-by: Rémy Rakic <[email protected]>
@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 |
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.