2015-03-16 16:26:28 -04:00
|
|
|
// Check that we report an error if an upcast box is moved twice.
|
|
|
|
|
|
|
|
trait Foo { fn dummy(&self); }
|
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
fn consume(_: Box<dyn Foo>) {
|
2015-03-16 16:26:28 -04:00
|
|
|
}
|
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
fn foo(b: Box<dyn Foo + Send>) {
|
2015-03-16 16:26:28 -04:00
|
|
|
consume(b);
|
|
|
|
consume(b); //~ ERROR use of moved value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|