mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
15 lines
169 B
Rust
15 lines
169 B
Rust
fn foo(x: &u32) -> &u32 {
|
|
let y;
|
|
|
|
{
|
|
let x = 32;
|
|
y = &x
|
|
//~^ ERROR does not live long enough
|
|
}
|
|
|
|
println!("{}", y);
|
|
x
|
|
}
|
|
|
|
fn main() { }
|