blob: 0905c8bb1eb12c8a8f5f354e10de2e38fcfaf7be (
plain)
1
2
3
4
5
6
7
8
9
10
|
// compile-flags: -Z borrowck=compare
fn foo() -> &'static u32 {
let x = 0;
&x
//~^ ERROR `x` does not live long enough (Ast) [E0597]
//~| ERROR cannot return reference to local variable `x` (Mir) [E0515]
}
fn main() { }
|