]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/pattern_substs_on_tuple_struct.rs
Auto merge of #105716 - chriswailes:ndk-update-redux, r=pietroalbini
[rust.git] / tests / ui / nll / user-annotations / pattern_substs_on_tuple_struct.rs
1 struct Foo<'a>(&'a u32);
2
3 fn in_let() {
4     let y = 22;
5     let foo = Foo(&y);
6     //~^ ERROR `y` does not live long enough
7     let Foo::<'static>(_z) = foo;
8 }
9
10 fn in_match() {
11     let y = 22;
12     let foo = Foo(&y);
13     //~^ ERROR `y` does not live long enough
14     match foo {
15         Foo::<'static>(_z) => {
16         }
17     }
18 }
19
20 fn main() { }