mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 12:44:40 +00:00
7f2068cc2b
Fix: redundant_pattern_matching drop order Fixes #5746 A note about the change in drop order is added when the scrutinee (or any temporary in the expression) isn't known to be safe to drop in any order (i.e. doesn't implement the `Drop` trait, or contain such a type). There is a whitelist for some `std` types, but it's incomplete. Currently just `Vec<_>`, `Box<_>`, `Rc<_>` and `Arc<_>`, but only if the contained type is also safe to drop in any order. Another lint for when the drop order changes could be added as allowed by default, but the drop order requirement is pretty subtle in this case. I think the note added to the lint should be enough to make someone think before applying the change. changelog: Added a note to `redundant_pattern_matching` when the change in drop order might matter |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |