1 2 3 4 5 6 7 8 9 10 11 12 13 14
// Check that we report an error if an upcast box is moved twice. trait Foo { fn dummy(&self); } fn consume(_: Box<dyn Foo>) { } fn foo(b: Box<dyn Foo + Send>) { consume(b); consume(b); //~ ERROR use of moved value } fn main() { }