1 // Stacked Borrows detects that we are casting & to &mut and so it changes why we fail
2 //@compile-flags: -Zmiri-disable-stacked-borrows
4 use std::mem::transmute;
6 #[allow(mutable_transmutes)]
9 let s = "this is a test";
10 transmute::<&[u8], &mut [u8]>(s.as_bytes())[4] = 42; //~ ERROR: read-only