2018-07-11 21:07:17 +02:00
|
|
|
// ignore-test FIXME: we are not making these statics read-only any more?
|
2016-09-13 20:17:52 -06:00
|
|
|
static X: usize = 5;
|
|
|
|
|
|
|
|
#[allow(mutable_transmutes)]
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
2018-05-09 19:24:25 +02:00
|
|
|
*std::mem::transmute::<&usize, &mut usize>(&X) = 6; //~ ERROR constant evaluation error [E0080]
|
|
|
|
//~^ NOTE tried to modify constant memory
|
2016-09-13 20:17:52 -06:00
|
|
|
assert_eq!(X, 6);
|
|
|
|
}
|
|
|
|
}
|