}
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() {}
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() { }
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`
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() { }
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
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() {}
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() {}
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() {}
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() {}