Skip to content

Commit 75167bb

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 + ac5b02d commit 75167bb

23 files changed

+472
-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

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![feature(drain_filter)]
55
#![feature(in_band_lifetimes)]
66
#![feature(iter_zip)]
7+
#![feature(iter_map_while)]
78
#![feature(once_cell)]
89
#![feature(rustc_private)]
910
#![feature(stmt_expr_attributes)]
@@ -324,7 +325,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
324325
store.register_late_pass(|| Box::new(same_name_method::SameNameMethod));
325326
store.register_late_pass(|| Box::new(map_clone::MapClone));
326327
store.register_late_pass(|| Box::new(map_err_ignore::MapErrIgnore));
327-
store.register_late_pass(|| Box::new(shadow::Shadow));
328+
store.register_late_pass(|| Box::new(shadow::Shadow::default()));
328329
store.register_late_pass(|| Box::new(unit_types::UnitTypes));
329330
store.register_late_pass(|| Box::new(loops::Loops));
330331
store.register_late_pass(|| Box::new(main_recursion::MainRecursion::default()));

0 commit comments

Comments
 (0)