3 use std::mem::{transmute, ManuallyDrop};
5 const S: &'static mut str = &mut " hello ";
6 //~^ ERROR: mutable references are not allowed in the final value of constants
7 //~| ERROR: mutation through a reference is not allowed in constants
8 //~| ERROR: cannot borrow data in a `&` reference as mutable
9 //~| ERROR: it is undefined behavior to use this value
11 const fn trigger() -> [(); unsafe {
12 let s = transmute::<(*const u8, usize), &ManuallyDrop<str>>((S.as_ptr(), 3));