about summary refs log tree commit diff
path: root/tests/ui/error-codes
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-02-01 15:58:07 +0100
committerLeón Orell Valerian Liehr <me@fmease.dev>2024-02-01 16:18:03 +0100
commit02320b502d6ae1398126a068cd1efbb96f87faaa (patch)
treeed185a086314814246c070e51fcabeb407f01cb0 /tests/ui/error-codes
parentcb4d9a1902b3ea17e93872dafb76d24aa6295c47 (diff)
downloadrust-02320b502d6ae1398126a068cd1efbb96f87faaa.tar.gz
rust-02320b502d6ae1398126a068cd1efbb96f87faaa.zip
Improve the diagnostics for unused generic parameters
Diffstat (limited to 'tests/ui/error-codes')
-rw-r--r--tests/ui/error-codes/E0091.stderr10
-rw-r--r--tests/ui/error-codes/E0392.stderr6
2 files changed, 11 insertions, 5 deletions
diff --git a/tests/ui/error-codes/E0091.stderr b/tests/ui/error-codes/E0091.stderr
index a596b75e481..c1427ec6686 100644
--- a/tests/ui/error-codes/E0091.stderr
+++ b/tests/ui/error-codes/E0091.stderr
@@ -1,14 +1,20 @@
-error[E0091]: type parameter `T` is unused
+error[E0091]: type parameter `T` is never used
   --> $DIR/E0091.rs:1:10
    |
 LL | type Foo<T> = u32;
    |          ^ unused type parameter
+   |
+   = help: consider removing `T` or referring to it in the body of the type alias
+   = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead
 
-error[E0091]: type parameter `B` is unused
+error[E0091]: type parameter `B` is never used
   --> $DIR/E0091.rs:2:14
    |
 LL | type Foo2<A, B> = Box<A>;
    |              ^ unused type parameter
+   |
+   = help: consider removing `B` or referring to it in the body of the type alias
+   = help: if you intended `B` to be a const parameter, use `const B: /* Type */` instead
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/error-codes/E0392.stderr b/tests/ui/error-codes/E0392.stderr
index ecbfd5584d5..9971267e927 100644
--- a/tests/ui/error-codes/E0392.stderr
+++ b/tests/ui/error-codes/E0392.stderr
@@ -1,11 +1,11 @@
-error[E0392]: parameter `T` is never used
+error[E0392]: type parameter `T` is never used
   --> $DIR/E0392.rs:1:10
    |
 LL | enum Foo<T> { Bar }
-   |          ^ unused parameter
+   |          ^ unused type parameter
    |
    = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
-   = help: if you intended `T` to be a const parameter, use `const T: usize` instead
+   = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead
 
 error: aborting due to 1 previous error