diff options
Diffstat (limited to 'src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr')
-rw-r--r-- | src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr index d96e86393..eba65a618 100644 --- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr +++ b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr @@ -8,7 +8,15 @@ LL | drop::<U>(_x1); | --- closure is `FnOnce` because it moves the variable `_x1` out of its environment ... LL | accept_fn_mut(&c1); - | ------------- the requirement to implement `FnMut` derives from here + | ------------- --- the requirement to implement `FnMut` derives from here + | | + | required by a bound introduced by this call + | +note: required by a bound in `accept_fn_mut` + --> $DIR/move-ref-patterns-closure-captures.rs:4:31 + | +LL | fn accept_fn_mut(_: &impl FnMut()) {} + | ^^^^^^^ required by this bound in `accept_fn_mut` error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce` --> $DIR/move-ref-patterns-closure-captures.rs:9:14 @@ -20,7 +28,15 @@ LL | drop::<U>(_x1); | --- closure is `FnOnce` because it moves the variable `_x1` out of its environment ... LL | accept_fn(&c1); - | --------- the requirement to implement `Fn` derives from here + | --------- --- the requirement to implement `Fn` derives from here + | | + | required by a bound introduced by this call + | +note: required by a bound in `accept_fn` + --> $DIR/move-ref-patterns-closure-captures.rs:5:27 + | +LL | fn accept_fn(_: &impl Fn()) {} + | ^^^^ required by this bound in `accept_fn` error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut` --> $DIR/move-ref-patterns-closure-captures.rs:20:14 @@ -32,7 +48,15 @@ LL | drop::<&mut U>(_x2); | --- closure is `FnMut` because it mutates the variable `_x2` here ... LL | accept_fn(&c2); - | --------- the requirement to implement `Fn` derives from here + | --------- --- the requirement to implement `Fn` derives from here + | | + | required by a bound introduced by this call + | +note: required by a bound in `accept_fn` + --> $DIR/move-ref-patterns-closure-captures.rs:5:27 + | +LL | fn accept_fn(_: &impl Fn()) {} + | ^^^^ required by this bound in `accept_fn` error: aborting due to 3 previous errors |