]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-consume-upcast-box.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[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 }