rust/src/test/ui/issues/issue-46472.rs
2018-12-25 21:08:33 -07:00

10 lines
239 B
Rust

// compile-flags: -Z borrowck=compare
fn bar<'a>() -> &'a mut u32 {
&mut 4
//~^ ERROR borrowed value does not live long enough (Ast) [E0597]
//~| ERROR cannot return reference to temporary value (Mir) [E0515]
}
fn main() { }