3 fn leak<T>(mut b: Box<T>) -> &'static mut T {
4 // isn't this supposed to be safe?
5 let inner = &mut *b as *mut _;
10 fn evil(mut s: &'static mut String)
13 let alias: &'static mut String = s;
14 let inner: &str = &alias;
16 *s = String::new(); //~ ERROR cannot assign
17 let _spray = "0wned".to_owned();
18 // ... and then use it
19 println!("{}", inner);
23 evil(leak(Box::new("hello".to_owned())));