]> git.lizzy.rs Git - rust.git/commitdiff
add more to the ERROR messages
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 19 Oct 2018 20:43:46 +0000 (16:43 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Fri, 19 Oct 2018 20:44:01 +0000 (16:44 -0400)
src/test/ui/underscore-lifetime/in-binder.rs
src/test/ui/underscore-lifetime/in-fn-return-illegal.rs
src/test/ui/underscore-lifetime/in-fn-return-illegal.stderr
src/test/ui/underscore-lifetime/in-struct.rs
src/test/ui/underscore-lifetime/in-struct.stderr
src/test/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rs
src/test/ui/underscore-lifetime/where-clause-inherent-impl-underscore.rs
src/test/ui/underscore-lifetime/where-clause-trait-impl-region.rs
src/test/ui/underscore-lifetime/where-clause-trait-impl-underscore.rs

index fc0602a0ba96888b12968eb9969a98561afd597b..c94947d1eab1ccc5c08613518867a1077899aefd 100644 (file)
@@ -10,36 +10,36 @@ struct IceCube<'a> {
 }
 
 impl<'_> IceCube<'_> {}
-//[Rust2015]~^ ERROR
-//[Rust2015]~| ERROR
-//[Rust2018]~^^^ ERROR
+//[Rust2015]~^ ERROR `'_` cannot be used here
+//[Rust2015]~| ERROR missing lifetime specifier
+//[Rust2018]~^^^ ERROR `'_` cannot be used here
 
 struct Struct<'_> {
-//[Rust2015]~^ ERROR
-//[Rust2018]~^^ ERROR
+//[Rust2015]~^ ERROR `'_` cannot be used here
+//[Rust2018]~^^ ERROR `'_` cannot be used here
     v: Vec<&'static char>
 }
 
 enum Enum<'_> {
-//[Rust2015]~^ ERROR
-//[Rust2018]~^^ ERROR
+//[Rust2015]~^ ERROR `'_` cannot be used here
+//[Rust2018]~^^ ERROR `'_` cannot be used here
     Variant
 }
 
 union Union<'_> {
-//[Rust2015]~^ ERROR
-//[Rust2018]~^^ ERROR
+//[Rust2015]~^ ERROR `'_` cannot be used here
+//[Rust2018]~^^ ERROR `'_` cannot be used here
     a: u32
 }
 
 trait Trait<'_> {
-//[Rust2015]~^ ERROR
-//[Rust2018]~^^ ERROR
+//[Rust2015]~^ ERROR `'_` cannot be used here
+//[Rust2018]~^^ ERROR `'_` cannot be used here
 }
 
 fn foo<'_>() {
-    //[Rust2015]~^ ERROR
-    //[Rust2018]~^^ ERROR
+    //[Rust2015]~^ ERROR `'_` cannot be used here
+    //[Rust2018]~^^ ERROR `'_` cannot be used here
 }
 
 fn main() {}
index 959254b8bb8156023bedf7b8d99584ca4913dc24..09f3abd9135cb9c2da375562f93831663c719884 100644 (file)
@@ -12,6 +12,6 @@
 
 use std::fmt::Debug;
 
-fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } //~ ERROR
+fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } //~ ERROR missing lifetime specifier
 
 fn main() { }
index 6536e6b278eda082c1b61d7b4bd03b7347f25c50..f3ba3e529242616f6167315f0e9cfb6aa725cd5d 100644 (file)
@@ -1,7 +1,7 @@
 error[E0106]: missing lifetime specifier
   --> $DIR/in-fn-return-illegal.rs:15:30
    |
-LL | fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } //~ ERROR
+LL | fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } //~ ERROR missing lifetime specifier
    |                              ^^ expected lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`
index 201147840f6ef808e703f8671d3f6be6bf253d3f..1c1a9ef62d5947dee6368c350be0e0f1a4941d3e 100644 (file)
 use std::fmt::Debug;
 
 struct Foo {
-    x: &'_ u32, //~ ERROR
+    x: &'_ u32, //~ ERROR missing lifetime specifier
 }
 
 enum Bar {
-    Variant(&'_ u32), //~ ERROR
+    Variant(&'_ u32), //~ ERROR missing lifetime specifier
 }
 
 fn main() { }
index 072bd6b7d0bcf7336b65d89e3a21172891ad275a..d288995d4bb820745fe1846f35d5711b2b131d87 100644 (file)
@@ -1,13 +1,13 @@
 error[E0106]: missing lifetime specifier
   --> $DIR/in-struct.rs:16:9
    |
-LL |     x: &'_ u32, //~ ERROR
+LL |     x: &'_ u32, //~ ERROR missing lifetime specifier
    |         ^^ expected lifetime parameter
 
 error[E0106]: missing lifetime specifier
   --> $DIR/in-struct.rs:20:14
    |
-LL |     Variant(&'_ u32), //~ ERROR
+LL |     Variant(&'_ u32), //~ ERROR missing lifetime specifier
    |              ^^ expected lifetime parameter
 
 error: aborting due to 2 previous errors
index ee6b35d878e8b400e23283a6a04152cebc8c46fb..43de30944cacb5d3403c678a36ec8e30d83be4be 100644 (file)
@@ -11,8 +11,8 @@ struct Foo<T> {
 impl<T> Foo<T>
 where
     T: WithType<&u32>
-//[rust2015]~^ ERROR
-//[rust2018]~^^ ERROR
+//[rust2015]~^ ERROR `&` without an explicit lifetime name cannot be used here
+//[rust2018]~^^ ERROR `&` without an explicit lifetime name cannot be used here
 { }
 
 fn main() {}
index 55aecbc9fcffe2fd0e126d4ce49a6a9c9d1b701d..b50cce335bd8c9808104eb9b4c5fd98540bdba86 100644 (file)
@@ -11,8 +11,8 @@ struct Foo<T> {
 impl<T> Foo<T>
 where
     T: WithRegion<'_>
-//[rust2015]~^ ERROR
-//[rust2018]~^^ ERROR
+//[rust2015]~^ ERROR `'_` cannot be used here
+//[rust2018]~^^ ERROR `'_` cannot be used here
 { }
 
 fn main() {}
index 47de6a7af9c081e1bd757214e189e51941a96522..f2d483e66e0138fef67cca860b28ed3bfcbb9979 100644 (file)
@@ -9,8 +9,8 @@ trait Foo { }
 impl<T> Foo for Vec<T>
 where
     T: WithType<&u32>
-//[rust2015]~^ ERROR
-//[rust2018]~^^ ERROR
+//[rust2015]~^ ERROR `&` without an explicit lifetime name cannot be used here
+//[rust2018]~^^ ERROR `&` without an explicit lifetime name cannot be used here
 { }
 
 fn main() {}
index 67db6be5361813f13b129351e5c03f32d80c7690..94e4426e822d92a9b54e6f8af94c7a51a328adf2 100644 (file)
@@ -9,8 +9,8 @@ trait Foo { }
 impl<T> Foo for Vec<T>
 where
     T: WithRegion<'_>
-//[rust2015]~^ ERROR
-//[rust2018]~^^ ERROR
+//[rust2015]~^ ERROR `'_` cannot be used here
+//[rust2018]~^^ ERROR `'_` cannot be used here
 { }
 
 fn main() {}