14 lines
279 B
Rust
14 lines
279 B
Rust
|
#![feature(const_let)]
|
||
|
|
||
|
use std::cell::Cell;
|
||
|
|
||
|
const FOO: &u32 = {
|
||
|
let mut a = 42;
|
||
|
{
|
||
|
let b: *mut u32 = &mut a; //~ ERROR may only refer to immutable values
|
||
|
unsafe { *b = 5; } //~ ERROR dereferencing raw pointers in constants
|
||
|
}
|
||
|
&{a}
|
||
|
};
|
||
|
|
||
|
fn main() {}
|