]> git.proxmox.com Git - rustc.git/blame - tests/ui/borrowck/borrowck-consume-upcast-box.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / borrowck / borrowck-consume-upcast-box.stderr
CommitLineData
b7449926 1error[E0382]: use of moved value: `b`
0731742a 2 --> $DIR/borrowck-consume-upcast-box.rs:10:13
b7449926 3 |
dc9dc135 4LL | fn foo(b: Box<dyn Foo + Send>) {
1b1a35ee 5 | - move occurs because `b` has type `Box<dyn Foo + Send>`, which does not implement the `Copy` trait
b7449926
XL
6LL | consume(b);
7 | - value moved here
532ac7d7 8LL | consume(b);
b7449926 9 | ^ value used here after move
6522a427
EL
10 |
11note: consider changing this parameter type in function `consume` to borrow instead if owning the value isn't necessary
12 --> $DIR/borrowck-consume-upcast-box.rs:5:15
13 |
14LL | fn consume(_: Box<dyn Foo>) {
15 | ------- ^^^^^^^^^^^^ this parameter takes ownership of the value
16 | |
17 | in this function
b7449926
XL
18
19error: aborting due to previous error
20
21For more information about this error, try `rustc --explain E0382`.