mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
10 lines
231 B
Rust
10 lines
231 B
Rust
fn main() {
|
|
let x: &'static u32 = {
|
|
let y = 42;
|
|
&y //~ ERROR does not live long enough
|
|
};
|
|
let x: &'static u32 = &{ //~ ERROR temporary value dropped while borrowed
|
|
let y = 42;
|
|
y
|
|
};
|
|
}
|