mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
15 lines
178 B
Rust
15 lines
178 B
Rust
//@run-pass
|
|
|
|
const FOO: &u32 = {
|
|
let mut a = 42;
|
|
{
|
|
let b: *mut u32 = &mut a;
|
|
unsafe { *b = 5; }
|
|
}
|
|
&{a}
|
|
};
|
|
|
|
fn main() {
|
|
assert_eq!(*FOO, 5);
|
|
}
|