Skip to content

Commit

Permalink
Remove initialization note from shadow lint
Browse files Browse the repository at this point in the history
  • Loading branch information
camsteffen committed Sep 27, 2021
1 parent 5ff8fb9 commit 02ebfc7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
2 changes: 0 additions & 2 deletions clippy_lints/src/shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ fn lint_shadow<'tcx>(
snippet(cx, expr.span, "..")
),
|diag| {
diag.span_note(expr.span, "initialization happens here");
diag.span_note(prev_span, "previous binding is here");
},
);
Expand All @@ -309,7 +308,6 @@ fn lint_shadow<'tcx>(
pattern_span,
&format!("`{}` is being shadowed", snippet(cx, pattern_span, "_")),
|diag| {
diag.span_note(expr.span, "initialization happens here");
diag.span_note(prev_span, "previous binding is here");
},
);
Expand Down
25 changes: 0 additions & 25 deletions tests/ui/shadow.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ LL | let x = { *x + 1 };
| ^
|
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
note: initialization happens here
--> $DIR/shadow.rs:30:13
|
LL | let x = { *x + 1 };
| ^^^^^^^^^^
note: previous binding is here
--> $DIR/shadow.rs:29:9
|
Expand All @@ -59,11 +54,6 @@ error: `x` is shadowed by `id(x)` which reuses the original value
LL | let x = id(x);
| ^
|
note: initialization happens here
--> $DIR/shadow.rs:31:13
|
LL | let x = id(x);
| ^^^^^
note: previous binding is here
--> $DIR/shadow.rs:30:9
|
Expand All @@ -76,11 +66,6 @@ error: `x` is shadowed by `(1, x)` which reuses the original value
LL | let x = (1, x);
| ^
|
note: initialization happens here
--> $DIR/shadow.rs:32:13
|
LL | let x = (1, x);
| ^^^^^^
note: previous binding is here
--> $DIR/shadow.rs:31:9
|
Expand All @@ -93,11 +78,6 @@ error: `x` is shadowed by `first(x)` which reuses the original value
LL | let x = first(x);
| ^
|
note: initialization happens here
--> $DIR/shadow.rs:33:13
|
LL | let x = first(x);
| ^^^^^^^^
note: previous binding is here
--> $DIR/shadow.rs:32:9
|
Expand All @@ -111,11 +91,6 @@ LL | let x = y;
| ^
|
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
note: initialization happens here
--> $DIR/shadow.rs:35:13
|
LL | let x = y;
| ^
note: previous binding is here
--> $DIR/shadow.rs:33:9
|
Expand Down

0 comments on commit 02ebfc7

Please sign in to comment.