File tree 3 files changed +21
-3
lines changed
3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>) {
422
422
panic_unimplemented:: UNIMPLEMENTED ,
423
423
shadow:: SHADOW_REUSE ,
424
424
shadow:: SHADOW_SAME ,
425
- shadow:: SHADOW_UNRELATED ,
426
425
strings:: STRING_ADD ,
427
426
write:: PRINT_STDOUT ,
428
427
write:: USE_DEBUG ,
@@ -452,6 +451,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>) {
452
451
needless_continue:: NEEDLESS_CONTINUE ,
453
452
non_expressive_names:: SIMILAR_NAMES ,
454
453
replace_consts:: REPLACE_CONSTS ,
454
+ shadow:: SHADOW_UNRELATED ,
455
455
strings:: STRING_ADD_ASSIGN ,
456
456
types:: CAST_POSSIBLE_TRUNCATION ,
457
457
types:: CAST_POSSIBLE_WRAP ,
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ declare_clippy_lint! {
71
71
/// ```
72
72
declare_clippy_lint ! {
73
73
pub SHADOW_UNRELATED ,
74
- restriction ,
74
+ pedantic ,
75
75
"rebinding a name without even using the original value"
76
76
}
77
77
Original file line number Diff line number Diff line change @@ -331,6 +331,24 @@ error: use of `unwrap_or` followed by a function call
331
331
343 | let _ = stringy.unwrap_or("".to_owned());
332
332
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`
333
333
334
+ error: `error_code` is shadowed by `123_i32`
335
+ --> $DIR/methods.rs:377:9
336
+ |
337
+ 377 | let error_code = 123_i32;
338
+ | ^^^^^^^^^^
339
+ |
340
+ = note: `-D shadow-unrelated` implied by `-D warnings`
341
+ note: initialization happens here
342
+ --> $DIR/methods.rs:377:22
343
+ |
344
+ 377 | let error_code = 123_i32;
345
+ | ^^^^^^^
346
+ note: previous binding is here
347
+ --> $DIR/methods.rs:364:9
348
+ |
349
+ 364 | let error_code = 123_i32;
350
+ | ^^^^^^^^^^
351
+
334
352
error: use of `expect` followed by a function call
335
353
--> $DIR/methods.rs:366:26
336
354
|
@@ -435,5 +453,5 @@ error: used unwrap() on an Option value. If you don't want to handle the None ca
435
453
|
436
454
= note: `-D option-unwrap-used` implied by `-D warnings`
437
455
438
- error: aborting due to 55 previous errors
456
+ error: aborting due to 56 previous errors
439
457
You can’t perform that action at this time.
0 commit comments