2 #![allow(unused_variables)]
3 #![allow(non_upper_case_globals)]
5 // Test that destructor on a struct runs successfully after the struct
6 // is boxed and converted to an object.
8 static mut value: usize = 0;
15 fn get(&self) -> usize;
19 fn get(&self) -> usize { self.name }
24 unsafe { value = self.name; }
30 let x = Box::new(Cat {name: 22});
31 let nyan: Box<dyn Dummy> = x as Box<dyn Dummy>;
34 assert_eq!(value, 22);