Skip to content

Commit 02ebfc7

Browse files
committed
Remove initialization note from shadow lint
1 parent 5ff8fb9 commit 02ebfc7

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

clippy_lints/src/shadow.rs

-2
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ fn lint_shadow<'tcx>(
298298
snippet(cx, expr.span, "..")
299299
),
300300
|diag| {
301-
diag.span_note(expr.span, "initialization happens here");
302301
diag.span_note(prev_span, "previous binding is here");
303302
},
304303
);
@@ -309,7 +308,6 @@ fn lint_shadow<'tcx>(
309308
pattern_span,
310309
&format!("`{}` is being shadowed", snippet(cx, pattern_span, "_")),
311310
|diag| {
312-
diag.span_note(expr.span, "initialization happens here");
313311
diag.span_note(prev_span, "previous binding is here");
314312
},
315313
);

tests/ui/shadow.stderr

-25
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ LL | let x = { *x + 1 };
4242
| ^
4343
|
4444
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
45-
note: initialization happens here
46-
--> $DIR/shadow.rs:30:13
47-
|
48-
LL | let x = { *x + 1 };
49-
| ^^^^^^^^^^
5045
note: previous binding is here
5146
--> $DIR/shadow.rs:29:9
5247
|
@@ -59,11 +54,6 @@ error: `x` is shadowed by `id(x)` which reuses the original value
5954
LL | let x = id(x);
6055
| ^
6156
|
62-
note: initialization happens here
63-
--> $DIR/shadow.rs:31:13
64-
|
65-
LL | let x = id(x);
66-
| ^^^^^
6757
note: previous binding is here
6858
--> $DIR/shadow.rs:30:9
6959
|
@@ -76,11 +66,6 @@ error: `x` is shadowed by `(1, x)` which reuses the original value
7666
LL | let x = (1, x);
7767
| ^
7868
|
79-
note: initialization happens here
80-
--> $DIR/shadow.rs:32:13
81-
|
82-
LL | let x = (1, x);
83-
| ^^^^^^
8469
note: previous binding is here
8570
--> $DIR/shadow.rs:31:9
8671
|
@@ -93,11 +78,6 @@ error: `x` is shadowed by `first(x)` which reuses the original value
9378
LL | let x = first(x);
9479
| ^
9580
|
96-
note: initialization happens here
97-
--> $DIR/shadow.rs:33:13
98-
|
99-
LL | let x = first(x);
100-
| ^^^^^^^^
10181
note: previous binding is here
10282
--> $DIR/shadow.rs:32:9
10383
|
@@ -111,11 +91,6 @@ LL | let x = y;
11191
| ^
11292
|
11393
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
114-
note: initialization happens here
115-
--> $DIR/shadow.rs:35:13
116-
|
117-
LL | let x = y;
118-
| ^
11994
note: previous binding is here
12095
--> $DIR/shadow.rs:33:9
12196
|

0 commit comments

Comments
 (0)