Move shadow_unrelated to pedantic

This commit is contained in:
Dale Wijnand
2018-08-09 17:26:22 +01:00
parent e6d92f95c6
commit 7933d445d1
3 changed files with 21 additions and 3 deletions

View File

@@ -422,7 +422,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>) {
panic_unimplemented::UNIMPLEMENTED, panic_unimplemented::UNIMPLEMENTED,
shadow::SHADOW_REUSE, shadow::SHADOW_REUSE,
shadow::SHADOW_SAME, shadow::SHADOW_SAME,
shadow::SHADOW_UNRELATED,
strings::STRING_ADD, strings::STRING_ADD,
write::PRINT_STDOUT, write::PRINT_STDOUT,
write::USE_DEBUG, write::USE_DEBUG,
@@ -452,6 +451,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>) {
needless_continue::NEEDLESS_CONTINUE, needless_continue::NEEDLESS_CONTINUE,
non_expressive_names::SIMILAR_NAMES, non_expressive_names::SIMILAR_NAMES,
replace_consts::REPLACE_CONSTS, replace_consts::REPLACE_CONSTS,
shadow::SHADOW_UNRELATED,
strings::STRING_ADD_ASSIGN, strings::STRING_ADD_ASSIGN,
types::CAST_POSSIBLE_TRUNCATION, types::CAST_POSSIBLE_TRUNCATION,
types::CAST_POSSIBLE_WRAP, types::CAST_POSSIBLE_WRAP,

View File

@@ -71,7 +71,7 @@ declare_clippy_lint! {
/// ``` /// ```
declare_clippy_lint! { declare_clippy_lint! {
pub SHADOW_UNRELATED, pub SHADOW_UNRELATED,
restriction, pedantic,
"rebinding a name without even using the original value" "rebinding a name without even using the original value"
} }

View File

@@ -331,6 +331,24 @@ error: use of `unwrap_or` followed by a function call
343 | let _ = stringy.unwrap_or("".to_owned()); 343 | let _ = stringy.unwrap_or("".to_owned());
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())` | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`
error: `error_code` is shadowed by `123_i32`
--> $DIR/methods.rs:377:9
|
377 | let error_code = 123_i32;
| ^^^^^^^^^^
|
= note: `-D shadow-unrelated` implied by `-D warnings`
note: initialization happens here
--> $DIR/methods.rs:377:22
|
377 | let error_code = 123_i32;
| ^^^^^^^
note: previous binding is here
--> $DIR/methods.rs:364:9
|
364 | let error_code = 123_i32;
| ^^^^^^^^^^
error: use of `expect` followed by a function call error: use of `expect` followed by a function call
--> $DIR/methods.rs:366:26 --> $DIR/methods.rs:366:26
| |
@@ -435,5 +453,5 @@ error: used unwrap() on an Option value. If you don't want to handle the None ca
| |
= note: `-D option-unwrap-used` implied by `-D warnings` = note: `-D option-unwrap-used` implied by `-D warnings`
error: aborting due to 55 previous errors error: aborting due to 56 previous errors