rust/tests/ui/borrowck/issue-46471.rs

8 lines
135 B
Rust
Raw Normal View History

2017-12-08 09:20:45 -06:00
fn foo() -> &'static u32 {
let x = 0;
&x
2019-05-02 17:34:15 -05:00
//~^ ERROR cannot return reference to local variable `x` [E0515]
2017-12-08 09:20:45 -06:00
}
fn main() { }