don't use a span_note
for ignored impls
This commit is contained in:
parent
fb1976011e
commit
d7645f4245
4 changed files with 6 additions and 35 deletions
|
@ -722,11 +722,7 @@ impl<'tcx> DeadVisitor<'tcx> {
|
||||||
traits_str,
|
traits_str,
|
||||||
is_are
|
is_are
|
||||||
);
|
);
|
||||||
let multispan = ign_traits
|
err.note(&msg);
|
||||||
.iter()
|
|
||||||
.map(|(_, impl_id)| self.tcx.def_span(*impl_id))
|
|
||||||
.collect::<Vec<_>>();
|
|
||||||
err.span_note(multispan, &msg);
|
|
||||||
}
|
}
|
||||||
err.emit();
|
err.emit();
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,12 +5,7 @@ LL | Void(Void),
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: `-W dead-code` implied by `-W unused`
|
= note: `-W dead-code` implied by `-W unused`
|
||||||
note: `Foo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
= note: `Foo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
||||||
--> $DIR/derive-uninhabited-enum-38885.rs:10:10
|
|
||||||
|
|
|
||||||
LL | #[derive(Debug)]
|
|
||||||
| ^^^^^
|
|
||||||
= note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
||||||
|
|
||||||
warning: 1 warning emitted
|
warning: 1 warning emitted
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,7 @@ error: field is never read: `f`
|
||||||
LL | struct B { f: () }
|
LL | struct B { f: () }
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
note: `B` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
|
= note: `B` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
|
||||||
--> $DIR/clone-debug-dead-code.rs:9:10
|
|
||||||
|
|
|
||||||
LL | #[derive(Clone)]
|
|
||||||
| ^^^^^
|
|
||||||
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
||||||
|
|
||||||
error: field is never read: `f`
|
error: field is never read: `f`
|
||||||
--> $DIR/clone-debug-dead-code.rs:14:12
|
--> $DIR/clone-debug-dead-code.rs:14:12
|
||||||
|
@ -29,12 +24,7 @@ error: field is never read: `f`
|
||||||
LL | struct C { f: () }
|
LL | struct C { f: () }
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
note: `C` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
= note: `C` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
||||||
--> $DIR/clone-debug-dead-code.rs:13:10
|
|
||||||
|
|
|
||||||
LL | #[derive(Debug)]
|
|
||||||
| ^^^^^
|
|
||||||
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
||||||
|
|
||||||
error: field is never read: `f`
|
error: field is never read: `f`
|
||||||
--> $DIR/clone-debug-dead-code.rs:18:12
|
--> $DIR/clone-debug-dead-code.rs:18:12
|
||||||
|
@ -42,12 +32,7 @@ error: field is never read: `f`
|
||||||
LL | struct D { f: () }
|
LL | struct D { f: () }
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
note: `D` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
= note: `D` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
||||||
--> $DIR/clone-debug-dead-code.rs:17:10
|
|
||||||
|
|
|
||||||
LL | #[derive(Debug,Clone)]
|
|
||||||
| ^^^^^ ^^^^^
|
|
||||||
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
||||||
|
|
||||||
error: field is never read: `f`
|
error: field is never read: `f`
|
||||||
--> $DIR/clone-debug-dead-code.rs:21:12
|
--> $DIR/clone-debug-dead-code.rs:21:12
|
||||||
|
|
|
@ -9,12 +9,7 @@ note: the lint level is defined here
|
||||||
|
|
|
|
||||||
LL | #![deny(dead_code)]
|
LL | #![deny(dead_code)]
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^
|
||||||
note: `Enum` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
|
= note: `Enum` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
|
||||||
--> $DIR/unused-variant.rs:3:10
|
|
||||||
|
|
|
||||||
LL | #[derive(Clone)]
|
|
||||||
| ^^^^^
|
|
||||||
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue