mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +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 |
||
---|---|---|
.. | ||
auxiliary | ||
cargo | ||
ui | ||
ui-cargo | ||
ui-internal | ||
ui-toml | ||
compile-test.rs | ||
dogfood.rs | ||
fmt.rs | ||
integration.rs | ||
lint_message_convention.rs | ||
missing-test-files.rs | ||
versioncheck.rs |