]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.rs
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / ui / nll / user-annotations / pattern_substs_on_tuple_enum_variant.rs
1 #![feature(nll)]
2
3 enum Foo<'a> {
4 Bar(&'a u32)
5 }
6
7 fn in_let() {
8 let y = 22;
9 let foo = Foo::Bar(&y);
10 //~^ ERROR `y` does not live long enough
11 let Foo::Bar::<'static>(_z) = foo;
12 }
13
14 fn in_match() {
15 let y = 22;
16 let foo = Foo::Bar(&y);
17 //~^ ERROR `y` does not live long enough
18 match foo {
19 Foo::Bar::<'static>(_z) => {
20 }
21 }
22 }
23
24 fn main() { }