rust/src/test/ui/nll/borrowed-local-error.rs
2018-12-25 21:08:33 -07:00

15 lines
219 B
Rust

#![feature(nll)]
fn gimme(x: &(u32,)) -> &u32 {
&x.0
}
fn main() {
let x = gimme({
let v = (22,);
&v
//~^ ERROR `v` does not live long enough [E0597]
});
println!("{:?}", x);
}