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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
135 B
Rust
Raw Normal View History

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