2018-10-11 14:51:44 -05: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 00:57:41 -05:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 14:51:44 -05:00
|
|
|
|
|
|
|
struct Struct<'_> {
|
2022-03-06 08:44:48 -06:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 14:51:44 -05:00
|
|
|
v: Vec<&'static char>
|
|
|
|
}
|
|
|
|
|
|
|
|
enum Enum<'_> {
|
2022-03-06 08:44:48 -06:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 14:51:44 -05:00
|
|
|
Variant
|
|
|
|
}
|
|
|
|
|
|
|
|
union Union<'_> {
|
2022-03-06 08:44:48 -06:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 14:51:44 -05:00
|
|
|
a: u32
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Trait<'_> {
|
2022-03-06 08:44:48 -06:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 14:51:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo<'_>() {
|
2018-10-20 00:57:41 -05:00
|
|
|
//~^ ERROR `'_` cannot be used here
|
2018-10-11 14:51:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|