2019-05-05 12:02:32 +01:00
|
|
|
error[E0507]: cannot move out of `*v`, as `v` is a captured variable in an `FnMut` closure
|
2019-04-22 08:40:08 +01:00
|
|
|
--> $DIR/issue-4335.rs:6:20
|
|
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
LL | fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> {
|
2019-04-22 08:40:08 +01:00
|
|
|
| - captured outer variable
|
|
|
|
LL | id(Box::new(|| *v))
|
2022-06-27 07:45:35 +02:00
|
|
|
| -- ^^ move occurs because `*v` has type `T`, which does not implement the `Copy` trait
|
|
|
|
| |
|
2021-07-25 20:05:41 +02:00
|
|
|
| captured by this `FnMut` closure
|
2019-04-22 08:40:08 +01:00
|
|
|
|
2019-11-08 22:54:00 +00:00
|
|
|
error: aborting due to previous error
|
2017-12-10 22:47:55 +03:00
|
|
|
|
2019-11-08 22:54:00 +00:00
|
|
|
For more information about this error, try `rustc --explain E0507`.
|