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