about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorTimo <30553356+y21@users.noreply.github.com>2025-01-22 15:38:43 +0000
committerGitHub <noreply@github.com>2025-01-22 15:38:43 +0000
commitc024c1327bfd0540a0c85e62df1f1527f05fe03f (patch)
treeb3280fabc35fbc56e55385346efdbc328ce93392 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent67e6bf33fee137e8419863342bac0eecaae0f221 (diff)
parent9dca770aec2ef3cec721e5e9852d8a2c646695f0 (diff)
downloadrust-c024c1327bfd0540a0c85e62df1f1527f05fe03f.tar.gz
rust-c024c1327bfd0540a0c85e62df1f1527f05fe03f.zip
`unnecessary_semicolon`: do not lint if it may cause borrow errors (#14049)
Before edition 2024, some temporaries used in scrutinees of 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.

changelog: [`unnecessary_semicolon`]: prevent borrow errors in editions
lower than 2024

r? @y21
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions