Skip to content

Commit 4369a67

Browse files
committed
Auto merge of rust-lang#10163 - c410-f3r:lock-1, r=llogiq
[significant_drop_tightening] Add MVP cc rust-lang#9399 Creates the lint with minimum functionalities, which is a good start IMO. --- changelog: new lint: [`significant_drop_tightening`] [rust-lang#10163](rust-lang/rust-clippy#10163) <!-- changelog_checked -->
2 parents 86fb33a + 1b286b1 commit 4369a67

7 files changed

+551
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4734,6 +4734,7 @@ Released 2018-09-13
47344734
[`should_assert_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#should_assert_eq
47354735
[`should_implement_trait`]: https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
47364736
[`significant_drop_in_scrutinee`]: https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_in_scrutinee
4737+
[`significant_drop_tightening`]: https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
47374738
[`similar_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#similar_names
47384739
[`single_char_add_str`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
47394740
[`single_char_lifetime_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_char_lifetime_names

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
537537
crate::shadow::SHADOW_REUSE_INFO,
538538
crate::shadow::SHADOW_SAME_INFO,
539539
crate::shadow::SHADOW_UNRELATED_INFO,
540+
crate::significant_drop_tightening::SIGNIFICANT_DROP_TIGHTENING_INFO,
540541
crate::single_char_lifetime_names::SINGLE_CHAR_LIFETIME_NAMES_INFO,
541542
crate::single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS_INFO,
542543
crate::size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT_INFO,

clippy_lints/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![feature(binary_heap_into_iter_sorted)]
33
#![feature(box_patterns)]
44
#![feature(drain_filter)]
5+
#![feature(if_let_guard)]
56
#![feature(iter_intersperse)]
67
#![feature(let_chains)]
78
#![feature(lint_reasons)]
@@ -263,6 +264,7 @@ mod semicolon_block;
263264
mod semicolon_if_nothing_returned;
264265
mod serde_api;
265266
mod shadow;
267+
mod significant_drop_tightening;
266268
mod single_char_lifetime_names;
267269
mod single_component_path_imports;
268270
mod size_of_in_element_count;
@@ -558,6 +560,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
558560
store.register_late_pass(|_| Box::new(eta_reduction::EtaReduction));
559561
store.register_late_pass(|_| Box::new(mut_mut::MutMut));
560562
store.register_late_pass(|_| Box::new(mut_reference::UnnecessaryMutPassed));
563+
store.register_late_pass(|_| Box::<significant_drop_tightening::SignificantDropTightening<'_>>::default());
561564
store.register_late_pass(|_| Box::new(len_zero::LenZero));
562565
store.register_late_pass(|_| Box::new(attrs::Attributes));
563566
store.register_late_pass(|_| Box::new(blocks_in_if_conditions::BlocksInIfConditions));

0 commit comments

Comments
 (0)