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

15 lines
240 B
Rust

#![feature(nll)]
#![allow(warnings)]
fn gimme(x: &(u32,)) -> &u32 {
&x.0
}
fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
let v = 22;
gimme(&(v,))
//~^ ERROR cannot return value referencing temporary value [E0515]
}
fn main() {}