1 #![feature(box_syntax)]
9 impl fmt::Display for Number {
10 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11 write!(f, "{}", self.n)
16 list: Vec<Box<dyn ToString + 'static>> }
19 fn push(&mut self, n: Box<dyn ToString + 'static>) {
25 let n: Box<_> = box Number { n: 42 };
26 let mut l: Box<_> = box List { list: Vec::new() };
28 let x = n.to_string();
29 //~^ ERROR: borrow of moved value: `n`