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