Skip to content

Commit c294ec6

Browse files
committed
add more to the ERROR messages
1 parent df8adb5 commit c294ec6

9 files changed

+27
-27
lines changed

src/test/ui/underscore-lifetime/in-binder.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,36 @@ struct IceCube<'a> {
1010
}
1111

1212
impl<'_> IceCube<'_> {}
13-
//[Rust2015]~^ ERROR
14-
//[Rust2015]~| ERROR
15-
//[Rust2018]~^^^ ERROR
13+
//[Rust2015]~^ ERROR `'_` cannot be used here
14+
//[Rust2015]~| ERROR missing lifetime specifier
15+
//[Rust2018]~^^^ ERROR `'_` cannot be used here
1616

1717
struct Struct<'_> {
18-
//[Rust2015]~^ ERROR
19-
//[Rust2018]~^^ ERROR
18+
//[Rust2015]~^ ERROR `'_` cannot be used here
19+
//[Rust2018]~^^ ERROR `'_` cannot be used here
2020
v: Vec<&'static char>
2121
}
2222

2323
enum Enum<'_> {
24-
//[Rust2015]~^ ERROR
25-
//[Rust2018]~^^ ERROR
24+
//[Rust2015]~^ ERROR `'_` cannot be used here
25+
//[Rust2018]~^^ ERROR `'_` cannot be used here
2626
Variant
2727
}
2828

2929
union Union<'_> {
30-
//[Rust2015]~^ ERROR
31-
//[Rust2018]~^^ ERROR
30+
//[Rust2015]~^ ERROR `'_` cannot be used here
31+
//[Rust2018]~^^ ERROR `'_` cannot be used here
3232
a: u32
3333
}
3434

3535
trait Trait<'_> {
36-
//[Rust2015]~^ ERROR
37-
//[Rust2018]~^^ ERROR
36+
//[Rust2015]~^ ERROR `'_` cannot be used here
37+
//[Rust2018]~^^ ERROR `'_` cannot be used here
3838
}
3939

4040
fn foo<'_>() {
41-
//[Rust2015]~^ ERROR
42-
//[Rust2018]~^^ ERROR
41+
//[Rust2015]~^ ERROR `'_` cannot be used here
42+
//[Rust2018]~^^ ERROR `'_` cannot be used here
4343
}
4444

4545
fn main() {}

src/test/ui/underscore-lifetime/in-fn-return-illegal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
use std::fmt::Debug;
1414

15-
fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } //~ ERROR
15+
fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } //~ ERROR missing lifetime specifier
1616

1717
fn main() { }

src/test/ui/underscore-lifetime/in-fn-return-illegal.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0106]: missing lifetime specifier
22
--> $DIR/in-fn-return-illegal.rs:15:30
33
|
4-
LL | fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } //~ ERROR
4+
LL | fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } //~ ERROR missing lifetime specifier
55
| ^^ expected lifetime parameter
66
|
77
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`

src/test/ui/underscore-lifetime/in-struct.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
use std::fmt::Debug;
1414

1515
struct Foo {
16-
x: &'_ u32, //~ ERROR
16+
x: &'_ u32, //~ ERROR missing lifetime specifier
1717
}
1818

1919
enum Bar {
20-
Variant(&'_ u32), //~ ERROR
20+
Variant(&'_ u32), //~ ERROR missing lifetime specifier
2121
}
2222

2323
fn main() { }

src/test/ui/underscore-lifetime/in-struct.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0106]: missing lifetime specifier
22
--> $DIR/in-struct.rs:16:9
33
|
4-
LL | x: &'_ u32, //~ ERROR
4+
LL | x: &'_ u32, //~ ERROR missing lifetime specifier
55
| ^^ expected lifetime parameter
66

77
error[E0106]: missing lifetime specifier
88
--> $DIR/in-struct.rs:20:14
99
|
10-
LL | Variant(&'_ u32), //~ ERROR
10+
LL | Variant(&'_ u32), //~ ERROR missing lifetime specifier
1111
| ^^ expected lifetime parameter
1212

1313
error: aborting due to 2 previous errors

src/test/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ struct Foo<T> {
1111
impl<T> Foo<T>
1212
where
1313
T: WithType<&u32>
14-
//[rust2015]~^ ERROR
15-
//[rust2018]~^^ ERROR
14+
//[rust2015]~^ ERROR `&` without an explicit lifetime name cannot be used here
15+
//[rust2018]~^^ ERROR `&` without an explicit lifetime name cannot be used here
1616
{ }
1717

1818
fn main() {}

src/test/ui/underscore-lifetime/where-clause-inherent-impl-underscore.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ struct Foo<T> {
1111
impl<T> Foo<T>
1212
where
1313
T: WithRegion<'_>
14-
//[rust2015]~^ ERROR
15-
//[rust2018]~^^ ERROR
14+
//[rust2015]~^ ERROR `'_` cannot be used here
15+
//[rust2018]~^^ ERROR `'_` cannot be used here
1616
{ }
1717

1818
fn main() {}

src/test/ui/underscore-lifetime/where-clause-trait-impl-region.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ trait Foo { }
99
impl<T> Foo for Vec<T>
1010
where
1111
T: WithType<&u32>
12-
//[rust2015]~^ ERROR
13-
//[rust2018]~^^ ERROR
12+
//[rust2015]~^ ERROR `&` without an explicit lifetime name cannot be used here
13+
//[rust2018]~^^ ERROR `&` without an explicit lifetime name cannot be used here
1414
{ }
1515

1616
fn main() {}

src/test/ui/underscore-lifetime/where-clause-trait-impl-underscore.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ trait Foo { }
99
impl<T> Foo for Vec<T>
1010
where
1111
T: WithRegion<'_>
12-
//[rust2015]~^ ERROR
13-
//[rust2018]~^^ ERROR
12+
//[rust2015]~^ ERROR `'_` cannot be used here
13+
//[rust2018]~^^ ERROR `'_` cannot be used here
1414
{ }
1515

1616
fn main() {}

0 commit comments

Comments
 (0)