about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/instsimplify.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-01-08 16:22:17 +0000
committerbors <bors@rust-lang.org>2025-01-08 16:22:17 +0000
commita580b5c379b4fca50dfe5afc0fc0ce00921e4e00 (patch)
tree40024a316d1007e00dd46abd862919d604cc563d /compiler/rustc_mir_transform/src/instsimplify.rs
parent6afee111c2faf86ba884ea748967130abad37b52 (diff)
parentc55eefe8bc51f302cfc89d375198ca7211d4709b (diff)
downloadrust-a580b5c379b4fca50dfe5afc0fc0ce00921e4e00.tar.gz
rust-a580b5c379b4fca50dfe5afc0fc0ce00921e4e00.zip
Auto merge of #134523 - dingxiangfei2009:issue-130836-attempt-2, r=nikomatsakis
Run borrowck tests on BIDs and emit tail-expr-drop-order lints for violations

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.
Diffstat (limited to 'compiler/rustc_mir_transform/src/instsimplify.rs')
0 files changed, 0 insertions, 0 deletions