2018-08-08 12:28:26 +00:00
|
|
|
error[E0382]: use of moved value: `t`
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-move-moved-value-into-closure.rs:11:12
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-01-03 00:43:08 +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
|
2019-03-17 09:52:07 +00:00
|
|
|
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`.
|