about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2025-01-20 23:22:20 +0100
committerSamuel Tardieu <sam@rfc1149.net>2025-01-22 13:40:26 +0100
commit9dca770aec2ef3cec721e5e9852d8a2c646695f0 (patch)
tree03265576eda48ff0860a79e1e4bdaaec036a905f /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent71ba2cf1e5e2eb75824b993cf389f27701f2dd2a (diff)
downloadrust-9dca770aec2ef3cec721e5e9852d8a2c646695f0.tar.gz
rust-9dca770aec2ef3cec721e5e9852d8a2c646695f0.zip
`unnecessary_semicolon`: do not lint if it may cause borrow errors
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.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions