mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 09:38:26 +03:00
9dca770aec
Before edition 2024, some temporaries used in scrutinees in a `match` used as the last expression of a block may outlive some referenced local variables. Prevent those cases from happening by checking that alive temporaries with significant drop do have a static lifetime. The check is performed only for edition 2021 and earlier, and for the last statement if it would become the last expression of the block.