]> git.lizzy.rs Git - rust.git/blob - src/test/ui/underscore-lifetime/in-binder.rs
normalize stderr
[rust.git] / src / test / ui / underscore-lifetime / in-binder.rs
1 // Check that we error when `'_` appears as the name of a lifetime parameter.
2 //
3 // Regression test for #52098.
4
5 struct IceCube<'a> {
6     v: Vec<&'a char>
7 }
8
9 impl<'_> IceCube<'_> {}
10 //~^ ERROR `'_` cannot be used here
11
12 struct Struct<'_> {
13     //~^ ERROR `'_` cannot be used here
14     v: Vec<&'static char>
15 }
16
17 enum Enum<'_> {
18     //~^ ERROR `'_` cannot be used here
19     Variant
20 }
21
22 union Union<'_> {
23     //~^ ERROR `'_` cannot be used here
24     a: u32
25 }
26
27 trait Trait<'_> {
28     //~^ ERROR `'_` cannot be used here
29 }
30
31 fn foo<'_>() {
32     //~^ ERROR `'_` cannot be used here
33 }
34
35 fn main() {}