move_semantics4.rs (407B)
1 fn main() { 2 // You can optionally experiment here. 3 } 4 5 #[cfg(test)] 6 mod tests { 7 // TODO: Fix the compiler errors only by reordering the lines in the test. 8 // Don't add, change or remove any line. 9 #[test] 10 fn move_semantics4() { 11 let mut x = Vec::new(); 12 let y = &mut x; 13 y.push(42); 14 let z = &mut x; 15 z.push(13); 16 assert_eq!(x, [42, 13]); 17 } 18 }