2016-09-19 05:10:18 -05:00
|
|
|
use std::mem::transmute;
|
|
|
|
|
|
|
|
#[allow(mutable_transmutes)]
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
let bs = b"this is a test";
|
2018-07-15 04:21:56 -05:00
|
|
|
transmute::<&[u8], &mut [u8]>(bs)[4] = 42; //~ ERROR constant evaluation error
|
2018-05-09 10:45:16 -05:00
|
|
|
//~^ NOTE tried to modify constant memory
|
2016-09-19 05:10:18 -05:00
|
|
|
}
|
|
|
|
}
|