blob: d6c364f8e3f0c83afc4b14f08ceb155aac72e591 [file] [log] [blame]
#![feature(nll)]
enum Foo<'a> {
Bar(&'a u32)
}
fn in_let() {
let y = 22;
let foo = Foo::Bar(&y);
//~^ ERROR `y` does not live long enough
let Foo::Bar::<'static>(_z) = foo;
}
fn in_match() {
let y = 22;
let foo = Foo::Bar(&y);
//~^ ERROR `y` does not live long enough
match foo {
Foo::Bar::<'static>(_z) => {
}
}
}
fn main() { }