2018-10-11 19:51:44 +00:00
|
|
|
// Check that we error when `'_` appears as the name of a lifetime parameter.
|
|
|
|
//
|
|
|
|
// Regression test for #52098.
|
|
|
|
|
|
|
|
struct IceCube<'a> {
|
|
|
|
v: Vec<&'a char>
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'_> IceCube<'_> {}
|
2018-10-20 05:57:41 +00:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 19:51:44 +00:00
|
|
|
|
|
|
|
struct Struct<'_> {
|
2022-03-06 14:44:48 +00:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 19:51:44 +00:00
|
|
|
v: Vec<&'static char>
|
|
|
|
}
|
|
|
|
|
|
|
|
enum Enum<'_> {
|
2022-03-06 14:44:48 +00:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 19:51:44 +00:00
|
|
|
Variant
|
|
|
|
}
|
|
|
|
|
|
|
|
union Union<'_> {
|
2022-03-06 14:44:48 +00:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 19:51:44 +00:00
|
|
|
a: u32
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Trait<'_> {
|
2022-03-06 14:44:48 +00:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 19:51:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo<'_>() {
|
2018-10-20 05:57:41 +00:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 19:51:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|