2020-01-19 01:47:01 +00:00
|
|
|
error[E0525]: expected a closure that implements the `FnMut` trait, but this closure only implements `FnOnce`
|
2020-08-30 18:59:56 +00:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures.rs:9:14
|
2020-01-19 01:47:01 +00:00
|
|
|
|
|
|
|
|
LL | let c1 = || {
|
|
|
|
| ^^ this closure implements `FnOnce`, not `FnMut`
|
|
|
|
...
|
|
|
|
LL | drop::<U>(_x1);
|
|
|
|
| --- closure is `FnOnce` because it moves the variable `_x1` out of its environment
|
|
|
|
...
|
|
|
|
LL | accept_fn_mut(&c1);
|
2022-08-16 06:27:22 +00:00
|
|
|
| --- the requirement to implement `FnMut` derives from here
|
2020-01-19 01:47:01 +00:00
|
|
|
|
|
|
|
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
|
2020-08-30 18:59:56 +00:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures.rs:9:14
|
2020-01-19 01:47:01 +00:00
|
|
|
|
|
|
|
|
LL | let c1 = || {
|
|
|
|
| ^^ this closure implements `FnOnce`, not `Fn`
|
|
|
|
...
|
|
|
|
LL | drop::<U>(_x1);
|
|
|
|
| --- closure is `FnOnce` because it moves the variable `_x1` out of its environment
|
|
|
|
...
|
|
|
|
LL | accept_fn(&c1);
|
2022-08-16 06:27:22 +00:00
|
|
|
| --- the requirement to implement `Fn` derives from here
|
2020-01-19 01:47:01 +00:00
|
|
|
|
|
|
|
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
|
2020-08-30 18:59:56 +00:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures.rs:20:14
|
2020-01-19 01:47:01 +00:00
|
|
|
|
|
|
|
|
LL | let c2 = || {
|
|
|
|
| ^^ this closure implements `FnMut`, not `Fn`
|
|
|
|
...
|
|
|
|
LL | drop::<&mut U>(_x2);
|
|
|
|
| --- closure is `FnMut` because it mutates the variable `_x2` here
|
|
|
|
...
|
|
|
|
LL | accept_fn(&c2);
|
2022-08-16 06:27:22 +00:00
|
|
|
| --- the requirement to implement `Fn` derives from here
|
2020-01-19 01:47:01 +00:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0525`.
|