2018-11-21 03:42:40 -06:00
|
|
|
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
|
2018-11-24 07:38:31 -06:00
|
|
|
//~^ ERROR constant contains unimplemented expression
|
2018-11-21 03:42:40 -06:00
|
|
|
}
|
|
|
|
&{a}
|
|
|
|
};
|
|
|
|
|
2018-11-21 04:13:49 -06:00
|
|
|
fn main() {}
|