about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFabian Wolff <fabian.wolff@alumni.ethz.ch>2022-01-11 21:06:18 +0100
committerFabian Wolff <fabian.wolff@alumni.ethz.ch>2022-01-11 21:06:18 +0100
commitbd1f09d417c8b0e460f90bcd23b9067d55f7f7dd (patch)
treeecf68ca184f655511c07a0dee7a3e59e8d8ddf48 /src
parent2e2c86eba21a08cf505cd67073736d03ff3887ad (diff)
downloadrust-bd1f09d417c8b0e460f90bcd23b9067d55f7f7dd.tar.gz
rust-bd1f09d417c8b0e460f90bcd23b9067d55f7f7dd.zip
Annotate dead code lint with notes about ignored derived impls
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/derive-uninhabited-enum-38885.stderr5
-rw-r--r--src/test/ui/derives/clone-debug-dead-code.stderr18
-rw-r--r--src/test/ui/lint/dead-code/unused-variant.stderr5
3 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/derive-uninhabited-enum-38885.stderr b/src/test/ui/derive-uninhabited-enum-38885.stderr
index 72607629d3c..feaadd201b3 100644
--- a/src/test/ui/derive-uninhabited-enum-38885.stderr
+++ b/src/test/ui/derive-uninhabited-enum-38885.stderr
@@ -5,6 +5,11 @@ LL |     Void(Void),
    |     ^^^^^^^^^^
    |
    = note: `-W dead-code` implied by `-W unused`
+note: `Foo` has a derived impl for the trait `Debug`, but this is ignored during dead code analysis
+  --> $DIR/derive-uninhabited-enum-38885.rs:11:6
+   |
+LL | enum Foo {
+   |      ^^^
 
 warning: 1 warning emitted
 
diff --git a/src/test/ui/derives/clone-debug-dead-code.stderr b/src/test/ui/derives/clone-debug-dead-code.stderr
index 226007f3647..d7cab0815b8 100644
--- a/src/test/ui/derives/clone-debug-dead-code.stderr
+++ b/src/test/ui/derives/clone-debug-dead-code.stderr
@@ -15,18 +15,36 @@ error: field is never read: `f`
    |
 LL | struct B { f: () }
    |            ^^^^^
+   |
+note: `B` has a derived impl for the trait `Clone`, but this is ignored during dead code analysis
+  --> $DIR/clone-debug-dead-code.rs:10:8
+   |
+LL | struct B { f: () }
+   |        ^
 
 error: field is never read: `f`
   --> $DIR/clone-debug-dead-code.rs:14:12
    |
 LL | struct C { f: () }
    |            ^^^^^
+   |
+note: `C` has a derived impl for the trait `Debug`, but this is ignored during dead code analysis
+  --> $DIR/clone-debug-dead-code.rs:14:8
+   |
+LL | struct C { f: () }
+   |        ^
 
 error: field is never read: `f`
   --> $DIR/clone-debug-dead-code.rs:18:12
    |
 LL | struct D { f: () }
    |            ^^^^^
+   |
+note: `D` has derived impls for the traits `Clone` and `Debug`, but these are ignored during dead code analysis
+  --> $DIR/clone-debug-dead-code.rs:18:8
+   |
+LL | struct D { f: () }
+   |        ^
 
 error: field is never read: `f`
   --> $DIR/clone-debug-dead-code.rs:21:12
diff --git a/src/test/ui/lint/dead-code/unused-variant.stderr b/src/test/ui/lint/dead-code/unused-variant.stderr
index a547f5af4b0..abac1f29ce2 100644
--- a/src/test/ui/lint/dead-code/unused-variant.stderr
+++ b/src/test/ui/lint/dead-code/unused-variant.stderr
@@ -9,6 +9,11 @@ note: the lint level is defined here
    |
 LL | #![deny(dead_code)]
    |         ^^^^^^^^^
+note: `Enum` has a derived impl for the trait `Clone`, but this is ignored during dead code analysis
+  --> $DIR/unused-variant.rs:4:6
+   |
+LL | enum Enum {
+   |      ^^^^
 
 error: aborting due to previous error