Skip to content

Commit 25176f3

Browse files
PrestonFrombotahamec
authored andcommitted
Lint for significant drops who may have surprising lifetimes rust-lang#1
author Preston From <[email protected]> 1645164142 -0600 committer Preston From <[email protected]> 1650005351 -0600
1 parent 9789071 commit 25176f3

8 files changed

+1201
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3728,6 +3728,7 @@ Released 2018-09-13
37283728
[`skip_while_next`]: https://rust-lang.github.io/rust-clippy/master/index.html#skip_while_next
37293729
[`slow_vector_initialization`]: https://rust-lang.github.io/rust-clippy/master/index.html#slow_vector_initialization
37303730
[`stable_sort_primitive`]: https://rust-lang.github.io/rust-clippy/master/index.html#stable_sort_primitive
3731+
[`significant_drop_in_scrutinee`]: https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_in_scrutinee
37313732
[`str_to_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
37323733
[`string_add`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_add
37333734
[`string_add_assign`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_add_assign

clippy_lints/src/lib.register_lints.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ store.register_lints(&[
478478
size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT,
479479
slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
480480
stable_sort_primitive::STABLE_SORT_PRIMITIVE,
481+
significant_drop_in_scrutinee::SIGNIFICANT_DROP_IN_SCRUTINEE,
481482
strings::STRING_ADD,
482483
strings::STRING_ADD_ASSIGN,
483484
strings::STRING_FROM_UTF8_AS_BYTES,

clippy_lints/src/lib.register_nursery.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
2525
LintId::of(path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),
2626
LintId::of(redundant_pub_crate::REDUNDANT_PUB_CRATE),
2727
LintId::of(regex::TRIVIAL_REGEX),
28+
LintId::of(significant_drop_in_scrutinee::SIGNIFICANT_DROP_IN_SCRUTINEE),
2829
LintId::of(strings::STRING_LIT_AS_BYTES),
2930
LintId::of(suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS),
3031
LintId::of(trailing_empty_array::TRAILING_EMPTY_ARRAY),

clippy_lints/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ mod self_named_constructors;
367367
mod semicolon_if_nothing_returned;
368368
mod serde_api;
369369
mod shadow;
370+
mod significant_drop_in_scrutinee;
370371
mod single_char_lifetime_names;
371372
mod single_component_path_imports;
372373
mod size_of_in_element_count;
@@ -887,6 +888,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
887888
store.register_late_pass(move || Box::new(manual_bits::ManualBits::new(msrv)));
888889
store.register_late_pass(|| Box::new(default_union_representation::DefaultUnionRepresentation));
889890
store.register_late_pass(|| Box::new(only_used_in_recursion::OnlyUsedInRecursion));
891+
store.register_late_pass(|| Box::new(significant_drop_in_scrutinee::SignificantDropInScrutinee));
890892
store.register_late_pass(|| Box::new(dbg_macro::DbgMacro));
891893
let cargo_ignore_publish = conf.cargo_ignore_publish;
892894
store.register_late_pass(move || {

0 commit comments

Comments
 (0)