about summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0107.rs15
-rw-r--r--src/test/ui/error-codes/E0107.stderr46
2 files changed, 44 insertions, 17 deletions
diff --git a/src/test/ui/error-codes/E0107.rs b/src/test/ui/error-codes/E0107.rs
index 35173dcce30..c3dde72599b 100644
--- a/src/test/ui/error-codes/E0107.rs
+++ b/src/test/ui/error-codes/E0107.rs
@@ -9,15 +9,16 @@ enum Bar {
 
 struct Baz<'a, 'b, 'c> {
     buzz: Buzz<'a>,
-    //~^ ERROR E0107
-    //~| expected 2 lifetime arguments
+    //~^ ERROR this struct takes 2 lifetime arguments but only 1 lifetime argument was supplied
+    //~| HELP add missing lifetime argument
+
     bar: Bar<'a>,
-    //~^ ERROR E0107
-    //~| unexpected lifetime argument
+    //~^ ERROR this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
+    //~| HELP remove these generics
+
     foo2: Foo<'a, 'b, 'c>,
-    //~^ ERROR E0107
-    //~| unexpected lifetime argument
-    //~| unexpected lifetime argument
+    //~^ ERROR this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+    //~| HELP remove these lifetime arguments
 }
 
 fn main() {}
diff --git a/src/test/ui/error-codes/E0107.stderr b/src/test/ui/error-codes/E0107.stderr
index 486810ab113..30a2768d060 100644
--- a/src/test/ui/error-codes/E0107.stderr
+++ b/src/test/ui/error-codes/E0107.stderr
@@ -1,22 +1,48 @@
-error[E0107]: wrong number of lifetime arguments: expected 2, found 1
+error[E0107]: this struct takes 2 lifetime arguments but only 1 lifetime argument was supplied
   --> $DIR/E0107.rs:11:11
    |
 LL |     buzz: Buzz<'a>,
-   |           ^^^^^^^^ expected 2 lifetime arguments
+   |           ^^^^ -- supplied 1 lifetime argument
+   |           |
+   |           expected 2 lifetime arguments
+   |
+note: struct defined here, with 2 lifetime parameters: `'a`, `'b`
+  --> $DIR/E0107.rs:2:8
+   |
+LL | struct Buzz<'a, 'b>(&'a str, &'b str);
+   |        ^^^^ --  --
+help: add missing lifetime argument
+   |
+LL |     buzz: Buzz<'a, 'b>,
+   |                  ^^^^
 
-error[E0107]: wrong number of lifetime arguments: expected 0, found 1
-  --> $DIR/E0107.rs:14:14
+error[E0107]: this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
+  --> $DIR/E0107.rs:15:10
    |
 LL |     bar: Bar<'a>,
-   |              ^^ unexpected lifetime argument
+   |          ^^^---- help: remove these generics
+   |          |
+   |          expected 0 lifetime arguments
+   |
+note: enum defined here, with 0 lifetime parameters
+  --> $DIR/E0107.rs:4:6
+   |
+LL | enum Bar {
+   |      ^^^
 
-error[E0107]: wrong number of lifetime arguments: expected 1, found 3
-  --> $DIR/E0107.rs:17:19
+error[E0107]: this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+  --> $DIR/E0107.rs:19:11
    |
 LL |     foo2: Foo<'a, 'b, 'c>,
-   |                   ^^  ^^ unexpected lifetime argument
-   |                   |
-   |                   unexpected lifetime argument
+   |           ^^^   -------- help: remove these lifetime arguments
+   |           |
+   |           expected 1 lifetime argument
+   |
+note: struct defined here, with 1 lifetime parameter: `'a`
+  --> $DIR/E0107.rs:1:8
+   |
+LL | struct Foo<'a>(&'a str);
+   |        ^^^ --
 
 error: aborting due to 3 previous errors