Skip to content

Commit 8ffa408

Browse files
committed
Update tests for changes to cannot move errors
1 parent 9336b3d commit 8ffa408

File tree

100 files changed

+724
-1261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+724
-1261
lines changed

src/test/ui/access-mode-in-closures.stderr

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
error[E0507]: cannot move out of borrowed content
1+
error[E0507]: cannot move out of `s.0` which is behind a shared reference
22
--> $DIR/access-mode-in-closures.rs:8:15
33
|
44
LL | match *s { S(v) => v }
5-
| ^^ - data moved here
6-
| |
7-
| cannot move out of borrowed content
5+
| ^^ -
6+
| | |
7+
| | data moved here
8+
| | move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
89
| help: consider removing the `*`: `s`
9-
|
10-
note: move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
11-
--> $DIR/access-mode-in-closures.rs:8:22
12-
|
13-
LL | match *s { S(v) => v }
14-
| ^
1510

1611
error: aborting due to previous error
1712

src/test/ui/binop/binop-move-semantics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ fn illegal_dereference<T: Add<Output=()>>(mut x: T, y: T) {
2727
let m = &mut x;
2828
let n = &y;
2929

30-
*m //~ ERROR: cannot move out of borrowed content
30+
*m //~ ERROR: cannot move
3131
+
32-
*n; //~ ERROR: cannot move out of borrowed content
32+
*n; //~ ERROR: cannot move
3333
use_imm(n); use_mut(m);
3434
}
3535
struct Foo;

src/test/ui/binop/binop-move-semantics.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ LL | y;
4747
LL | use_mut(n); use_imm(m);
4848
| - borrow later used here
4949

50-
error[E0507]: cannot move out of borrowed content
50+
error[E0507]: cannot move out of `*m` which is behind a mutable reference
5151
--> $DIR/binop-move-semantics.rs:30:5
5252
|
5353
LL | *m
54-
| ^^ cannot move out of borrowed content
54+
| ^^ move occurs because `*m` has type `T`, which does not implement the `Copy` trait
5555

56-
error[E0507]: cannot move out of borrowed content
56+
error[E0507]: cannot move out of `*n` which is behind a shared reference
5757
--> $DIR/binop-move-semantics.rs:32:5
5858
|
5959
LL | *n;
60-
| ^^ cannot move out of borrowed content
60+
| ^^ move occurs because `*n` has type `T`, which does not implement the `Copy` trait
6161

6262
error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
6363
--> $DIR/binop-move-semantics.rs:54:5

src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.edition.stderr

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
error[E0507]: cannot move out of borrowed content
2-
--> $DIR/borrowck-feature-nll-overrides-migrate.rs:22:17
1+
error[E0507]: cannot move out of `foo` in pattern guard
2+
--> $DIR/borrowck-feature-nll-overrides-migrate.rs:22:18
33
|
44
LL | (|| { let bar = foo; bar.take() })();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
5+
| ^^ ---
6+
| | |
7+
| | move occurs because `foo` has type `&mut std::option::Option<&i32>`, which does not implement the `Copy` trait
8+
| | move occurs due to use in closure
9+
| move out of `foo` occurs here
10+
|
11+
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
612

713
error: aborting due to previous error
814

src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ fn main() {
2020
ref mut foo
2121
if {
2222
(|| { let bar = foo; bar.take() })();
23-
//[zflag]~^ ERROR cannot move out of borrowed content [E0507]
24-
//[edition]~^^ ERROR cannot move out of borrowed content [E0507]
23+
//[zflag]~^ ERROR cannot move out of `foo` in pattern guard [E0507]
24+
//[edition]~^^ ERROR cannot move out of `foo` in pattern guard [E0507]
2525
false
2626
} => {},
2727
Some(ref _s) => println!("Note this arm is bogus; the `Some` became `None` in the guard."),

src/test/ui/borrowck/borrowck-feature-nll-overrides-migrate.zflag.stderr

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
error[E0507]: cannot move out of borrowed content
2-
--> $DIR/borrowck-feature-nll-overrides-migrate.rs:22:17
1+
error[E0507]: cannot move out of `foo` in pattern guard
2+
--> $DIR/borrowck-feature-nll-overrides-migrate.rs:22:18
33
|
44
LL | (|| { let bar = foo; bar.take() })();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
5+
| ^^ ---
6+
| | |
7+
| | move occurs because `foo` has type `&mut std::option::Option<&i32>`, which does not implement the `Copy` trait
8+
| | move occurs due to use in closure
9+
| move out of `foo` occurs here
10+
|
11+
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
612

713
error: aborting due to previous error
814

src/test/ui/borrowck/borrowck-fn-in-const-a.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
const MOVE: fn(&String) -> String = {
55
fn broken(x: &String) -> String {
6-
return *x //~ ERROR cannot move out of borrowed content [E0507]
6+
return *x //~ ERROR cannot move
77
}
88
broken
99
};

src/test/ui/borrowck/borrowck-fn-in-const-a.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0507]: cannot move out of borrowed content
1+
error[E0507]: cannot move out of `*x` which is behind a shared reference
22
--> $DIR/borrowck-fn-in-const-a.rs:6:16
33
|
44
LL | return *x
5-
| ^^ cannot move out of borrowed content
5+
| ^^ move occurs because `*x` has type `std::string::String`, which does not implement the `Copy` trait
66

77
error: aborting due to previous error
88

src/test/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.stderr

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,32 @@
1-
error[E0507]: cannot move out of borrowed content
1+
error[E0507]: cannot move out of a shared reference
22
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:12:15
33
|
44
LL | for &a in x.iter() {
5-
| -- ^^^^^^^^ cannot move out of borrowed content
5+
| -- ^^^^^^^^
66
| ||
77
| |data moved here
8+
| |move occurs because `a` has type `&mut i32`, which does not implement the `Copy` trait
89
| help: consider removing the `&`: `a`
9-
|
10-
note: move occurs because `a` has type `&mut i32`, which does not implement the `Copy` trait
11-
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:12:10
12-
|
13-
LL | for &a in x.iter() {
14-
| ^
1510

16-
error[E0507]: cannot move out of borrowed content
11+
error[E0507]: cannot move out of a shared reference
1712
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:18:15
1813
|
1914
LL | for &a in &f.a {
20-
| -- ^^^^ cannot move out of borrowed content
15+
| -- ^^^^
2116
| ||
2217
| |data moved here
18+
| |move occurs because `a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
2319
| help: consider removing the `&`: `a`
24-
|
25-
note: move occurs because `a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
26-
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:18:10
27-
|
28-
LL | for &a in &f.a {
29-
| ^
3020

31-
error[E0507]: cannot move out of borrowed content
21+
error[E0507]: cannot move out of a shared reference
3222
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:15
3323
|
3424
LL | for &a in x.iter() {
35-
| -- ^^^^^^^^ cannot move out of borrowed content
25+
| -- ^^^^^^^^
3626
| ||
3727
| |data moved here
28+
| |move occurs because `a` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
3829
| help: consider removing the `&`: `a`
39-
|
40-
note: move occurs because `a` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
41-
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:10
42-
|
43-
LL | for &a in x.iter() {
44-
| ^
4530

4631
error: aborting due to 3 previous errors
4732

src/test/ui/borrowck/borrowck-in-static.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
static FN : &'static (dyn Fn() -> (Box<dyn Fn()->Box<i32>>) + Sync) = &|| {
44
let x = Box::new(0);
5-
Box::new(|| x) //~ ERROR cannot move out of captured variable in an `Fn` closure
5+
Box::new(|| x) //~ ERROR cannot move out of `x`, a captured variable in an `Fn` closure
66
};
77

88
fn main() {

0 commit comments

Comments
 (0)