]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/pattern_substs_on_brace_struct.rs
Rollup merge of #106946 - dtolnay:hashlinecolumn, r=m-ou-se
[rust.git] / tests / ui / nll / user-annotations / pattern_substs_on_brace_struct.rs
1 struct Foo<'a> { field: &'a u32 }
2
3 fn in_let() {
4     let y = 22;
5     let foo = Foo { field: &y };
6     //~^ ERROR `y` does not live long enough
7     let Foo::<'static> { field: _z } = foo;
8 }
9
10 fn in_main() {
11     let y = 22;
12     let foo = Foo { field: &y };
13     //~^ ERROR `y` does not live long enough
14     match foo {
15         Foo::<'static> { field: _z } => {
16         }
17     }
18 }
19
20 fn main() { }