mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
15 lines
243 B
Rust
15 lines
243 B
Rust
// 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() {
|
|
}
|