From 99861c0e88493e6f8fa1363d7040866bfef912ac Mon Sep 17 00:00:00 2001 From: Cameron Steffen Date: Mon, 11 Jan 2021 09:10:24 -0600 Subject: [PATCH] Remove initialization note from shadow lint --- clippy_lints/src/shadow.rs | 2 -- tests/ui/shadow.stderr | 25 ------------------------- 2 files changed, 27 deletions(-) diff --git a/clippy_lints/src/shadow.rs b/clippy_lints/src/shadow.rs index 9f48331c678..c17acfc8be7 100644 --- a/clippy_lints/src/shadow.rs +++ b/clippy_lints/src/shadow.rs @@ -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"); }, ); @@ -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"); }, ); diff --git a/tests/ui/shadow.stderr b/tests/ui/shadow.stderr index 7c1ad2949e9..23839749018 100644 --- a/tests/ui/shadow.stderr +++ b/tests/ui/shadow.stderr @@ -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 | @@ -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 | @@ -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 | @@ -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 | @@ -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 |