Skip to content

Commit f8303ad

Browse files
committed
Auto merge of #7338 - camsteffen:shadow, r=llogic
Re-write shadow lints changelog: Move shadow_unrelated to restriction changelog: The shadow lints find a lot more shadows and are not limited to certain patterns Drastically simplifies the implementation. Catches a lot more cases. I removed the "initialization happens here" note. It is not helpful IMO. Closes #318 Fixes #2890 Fixes #6563 Fixes #7588 Fixes #7620
2 parents a893eb9 + a17359c commit f8303ad

23 files changed

+471
-572
lines changed

clippy_lints/src/lib.register_pedantic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
8181
LintId::of(redundant_else::REDUNDANT_ELSE),
8282
LintId::of(ref_option_ref::REF_OPTION_REF),
8383
LintId::of(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED),
84-
LintId::of(shadow::SHADOW_UNRELATED),
8584
LintId::of(strings::STRING_ADD_ASSIGN),
8685
LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
8786
LintId::of(trait_bounds::TYPE_REPETITION_IN_BOUNDS),

clippy_lints/src/lib.register_restriction.rs

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), ve
5050
LintId::of(same_name_method::SAME_NAME_METHOD),
5151
LintId::of(shadow::SHADOW_REUSE),
5252
LintId::of(shadow::SHADOW_SAME),
53+
LintId::of(shadow::SHADOW_UNRELATED),
5354
LintId::of(strings::STRING_ADD),
5455
LintId::of(strings::STRING_TO_STRING),
5556
LintId::of(strings::STR_TO_STRING),

clippy_lints/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
324324
store.register_late_pass(|| Box::new(same_name_method::SameNameMethod));
325325
store.register_late_pass(|| Box::new(map_clone::MapClone));
326326
store.register_late_pass(|| Box::new(map_err_ignore::MapErrIgnore));
327-
store.register_late_pass(|| Box::new(shadow::Shadow));
327+
store.register_late_pass(|| Box::new(shadow::Shadow::default()));
328328
store.register_late_pass(|| Box::new(unit_types::UnitTypes));
329329
store.register_late_pass(|| Box::new(loops::Loops));
330330
store.register_late_pass(|| Box::new(main_recursion::MainRecursion::default()));

0 commit comments

Comments
 (0)