rust/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.stderr

19 lines
687 B
Plaintext
Raw Normal View History

2018-08-08 12:28:26 +00:00
error[E0382]: use of moved value: `t`
--> $DIR/borrowck-move-moved-value-into-closure.rs:11:12
2018-08-08 12:28:26 +00:00
|
LL | let t: Box<_> = box 3;
| - move occurs because `t` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
LL |
2018-08-08 12:28:26 +00:00
LL | call_f(move|| { *t + 1 });
| ------ - variable moved due to use in closure
| |
| value moved into closure here
LL | call_f(move|| { *t + 1 });
2018-08-08 12:28:26 +00:00
| ^^^^^^ - use occurs due to use in closure
| |
| value used here after move
error: aborting due to previous error
For more information about this error, try `rustc --explain E0382`.