about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
diff options
context:
space:
mode:
authorAaron Kofsky <aaronko@umich.edu>2022-05-29 14:35:00 -0400
committerAaron Kofsky <aaronko@umich.edu>2022-05-29 16:20:40 -0400
commit821b32bd406e9c29b2e9ca2a647d30021cff653d (patch)
treea05ed38eca626a19d6ffefbc7a354fd4cd198944 /tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
parente57884b6e96bede12447e21edcdc92fcac59ee46 (diff)
downloadrust-821b32bd406e9c29b2e9ca2a647d30021cff653d.tar.gz
rust-821b32bd406e9c29b2e9ca2a647d30021cff653d.zip
Add `let_underscore_drop` lint.
This lint checks for statements similar to `let _ = foo`, where `foo` is
a type that implements `Drop`. These types of let statements cause the
expression in them to be dropped immediately, instead of at the end of
the scope. Such behavior can be surprizing, especially if you are
relying on the value to be dropped at the end of the scope. Instead, the
binding should be an underscore prefixed name (like `_unused`) or the
value should explicitly be passed to `std::mem::drop()` if the value
really should be dropped immediately.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff')
0 files changed, 0 insertions, 0 deletions