2 #![allow(unused_must_use)]
3 // Test that we are able to reinitialize box with moved referent
5 static mut ORDER: [usize; 3] = [0, 0, 0];
6 static mut INDEX: usize = 0;
10 impl Drop for Dropee {
13 ORDER[INDEX] = self.0;
27 let mut x = Box::new(Dropee(1));
28 *x; // move out from `*x`
30 *x = Dropee(3); // re-initialize `*x`
33 assert_eq!(ORDER, [1, 2, 3]);