summaryrefslogtreecommitdiffstats
path: root/src/test/ui/pattern/move-ref-patterns
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/pattern/move-ref-patterns')
-rw-r--r--src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr6
-rw-r--r--src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr30
2 files changed, 30 insertions, 6 deletions
diff --git a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr b/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
index 5beca04d2..bac2db6ce 100644
--- a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
+++ b/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
@@ -35,7 +35,7 @@ error[E0502]: cannot borrow `arr[..]` as mutable because it is also borrowed as
--> $DIR/borrowck-move-ref-pattern.rs:13:16
|
LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
- | ---------------- immutable borrow occurs here
+ | ----------- immutable borrow occurs here
...
LL | let [_, _, ref mut _x2, _x3, mut _x4] = arr;
| ^^^^^^^^^^^ mutable borrow occurs here
@@ -47,7 +47,7 @@ error[E0505]: cannot move out of `arr[..]` because it is borrowed
--> $DIR/borrowck-move-ref-pattern.rs:13:29
|
LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
- | ---------------- borrow of `arr[..]` occurs here
+ | ----------- borrow of `arr[..]` occurs here
...
LL | let [_, _, ref mut _x2, _x3, mut _x4] = arr;
| ^^^ move out of `arr[..]` occurs here
@@ -59,7 +59,7 @@ error[E0505]: cannot move out of `arr[..]` because it is borrowed
--> $DIR/borrowck-move-ref-pattern.rs:13:34
|
LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
- | ---------------- borrow of `arr[..]` occurs here
+ | ----------- borrow of `arr[..]` occurs here
...
LL | let [_, _, ref mut _x2, _x3, mut _x4] = arr;
| ^^^^^^^ move out of `arr[..]` occurs here
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