]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-consume-upcast-box.rs
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
[rust.git] / tests / ui / borrowck / borrowck-consume-upcast-box.rs
1 // Check that we report an error if an upcast box is moved twice.
2
3 trait Foo { fn dummy(&self); }
4
5 fn consume(_: Box<dyn Foo>) {
6 }
7
8 fn foo(b: Box<dyn Foo + Send>) {
9     consume(b);
10     consume(b); //~ ERROR use of moved value
11 }
12
13 fn main() {
14 }