mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 16:45:37 +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() { }
|