mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +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() { }
|