Skip to content

Commit c1cfacf

Browse files
committed
Update NLL tests
1 parent fa72a81 commit c1cfacf

File tree

287 files changed

+794
-794
lines changed

Some content is hidden

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

287 files changed

+794
-794
lines changed

src/test/ui/E0508.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
22
--> $DIR/E0508.rs:5:18
33
|
4-
LL | let _value = array[0]; //~ ERROR [E0508]
4+
LL | let _value = array[0];
55
| ^^^^^^^^
66
| |
77
| cannot move out of here

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0507]: cannot move out of borrowed content
22
--> $DIR/access-mode-in-closures.rs:8:15
33
|
4-
LL | match *s { S(v) => v } //~ ERROR cannot move out
4+
LL | match *s { S(v) => v }
55
| ^^ - data moved here
66
| |
77
| cannot move out of borrowed content
@@ -10,7 +10,7 @@ LL | match *s { S(v) => v } //~ ERROR cannot move out
1010
note: move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
1111
--> $DIR/access-mode-in-closures.rs:8:22
1212
|
13-
LL | match *s { S(v) => v } //~ ERROR cannot move out
13+
LL | match *s { S(v) => v }
1414
| ^
1515

1616
error: aborting due to previous error

src/test/ui/associated-types/associated-types-outlives.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
33
|
44
LL | 's: loop { y = denormalise(&x); break }
55
| -- borrow of `x` occurs here
6-
LL | drop(x); //~ ERROR cannot move out of `x` because it is borrowed
6+
LL | drop(x);
77
| ^ move out of `x` occurs here
88
LL | return f(y);
99
| - borrow later used here

src/test/ui/augmented-assignments.nll.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error[E0505]: cannot move out of `x` because it is borrowed
22
--> $DIR/augmented-assignments.rs:16:5
33
|
4-
LL | x //~ error: use of moved value: `x`
4+
LL | x
55
| -
66
| |
77
| _____borrow of `x` occurs here
88
| |
9-
LL | | //~^ value used here after move
9+
LL | |
1010
LL | | +=
11-
LL | | x; //~ value moved here
11+
LL | | x;
1212
| | ^
1313
| | |
1414
| |_____move out of `x` occurs here
@@ -20,7 +20,7 @@ error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
2020
LL | let y = Int(2);
2121
| - help: consider changing this to be mutable: `mut y`
2222
...
23-
LL | y //~ error: cannot borrow immutable local variable `y` as mutable
23+
LL | y
2424
| ^ cannot borrow as mutable
2525

2626
error: aborting due to 2 previous errors

src/test/ui/binop/binop-consume-args.nll.stderr

+30-30
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
77
| consider adding a `Copy` constraint to this type argument
88
LL | lhs + rhs;
99
| --- value moved here
10-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
10+
LL | drop(lhs);
1111
| ^^^ value used here after move
1212

1313
error[E0382]: use of moved value: `rhs`
@@ -19,8 +19,8 @@ LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
1919
| consider adding a `Copy` constraint to this type argument
2020
LL | lhs + rhs;
2121
| --- value moved here
22-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
23-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
22+
LL | drop(lhs);
23+
LL | drop(rhs);
2424
| ^^^ value used here after move
2525

2626
error[E0382]: use of moved value: `lhs`
@@ -32,7 +32,7 @@ LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
3232
| consider adding a `Copy` constraint to this type argument
3333
LL | lhs - rhs;
3434
| --- value moved here
35-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
35+
LL | drop(lhs);
3636
| ^^^ value used here after move
3737

3838
error[E0382]: use of moved value: `rhs`
@@ -44,8 +44,8 @@ LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
4444
| consider adding a `Copy` constraint to this type argument
4545
LL | lhs - rhs;
4646
| --- value moved here
47-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
48-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
47+
LL | drop(lhs);
48+
LL | drop(rhs);
4949
| ^^^ value used here after move
5050

5151
error[E0382]: use of moved value: `lhs`
@@ -57,7 +57,7 @@ LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
5757
| consider adding a `Copy` constraint to this type argument
5858
LL | lhs * rhs;
5959
| --- value moved here
60-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
60+
LL | drop(lhs);
6161
| ^^^ value used here after move
6262

6363
error[E0382]: use of moved value: `rhs`
@@ -69,8 +69,8 @@ LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
6969
| consider adding a `Copy` constraint to this type argument
7070
LL | lhs * rhs;
7171
| --- value moved here
72-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
73-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
72+
LL | drop(lhs);
73+
LL | drop(rhs);
7474
| ^^^ value used here after move
7575

7676
error[E0382]: use of moved value: `lhs`
@@ -82,7 +82,7 @@ LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
8282
| consider adding a `Copy` constraint to this type argument
8383
LL | lhs / rhs;
8484
| --- value moved here
85-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
85+
LL | drop(lhs);
8686
| ^^^ value used here after move
8787

8888
error[E0382]: use of moved value: `rhs`
@@ -94,8 +94,8 @@ LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
9494
| consider adding a `Copy` constraint to this type argument
9595
LL | lhs / rhs;
9696
| --- value moved here
97-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
98-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
97+
LL | drop(lhs);
98+
LL | drop(rhs);
9999
| ^^^ value used here after move
100100

101101
error[E0382]: use of moved value: `lhs`
@@ -107,7 +107,7 @@ LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
107107
| consider adding a `Copy` constraint to this type argument
108108
LL | lhs % rhs;
109109
| --- value moved here
110-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
110+
LL | drop(lhs);
111111
| ^^^ value used here after move
112112

113113
error[E0382]: use of moved value: `rhs`
@@ -119,8 +119,8 @@ LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
119119
| consider adding a `Copy` constraint to this type argument
120120
LL | lhs % rhs;
121121
| --- value moved here
122-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
123-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
122+
LL | drop(lhs);
123+
LL | drop(rhs);
124124
| ^^^ value used here after move
125125

126126
error[E0382]: use of moved value: `lhs`
@@ -132,7 +132,7 @@ LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
132132
| consider adding a `Copy` constraint to this type argument
133133
LL | lhs & rhs;
134134
| --- value moved here
135-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
135+
LL | drop(lhs);
136136
| ^^^ value used here after move
137137

138138
error[E0382]: use of moved value: `rhs`
@@ -144,8 +144,8 @@ LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
144144
| consider adding a `Copy` constraint to this type argument
145145
LL | lhs & rhs;
146146
| --- value moved here
147-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
148-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
147+
LL | drop(lhs);
148+
LL | drop(rhs);
149149
| ^^^ value used here after move
150150

151151
error[E0382]: use of moved value: `lhs`
@@ -157,7 +157,7 @@ LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
157157
| consider adding a `Copy` constraint to this type argument
158158
LL | lhs | rhs;
159159
| --- value moved here
160-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
160+
LL | drop(lhs);
161161
| ^^^ value used here after move
162162

163163
error[E0382]: use of moved value: `rhs`
@@ -169,8 +169,8 @@ LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
169169
| consider adding a `Copy` constraint to this type argument
170170
LL | lhs | rhs;
171171
| --- value moved here
172-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
173-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
172+
LL | drop(lhs);
173+
LL | drop(rhs);
174174
| ^^^ value used here after move
175175

176176
error[E0382]: use of moved value: `lhs`
@@ -182,7 +182,7 @@ LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
182182
| consider adding a `Copy` constraint to this type argument
183183
LL | lhs ^ rhs;
184184
| --- value moved here
185-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
185+
LL | drop(lhs);
186186
| ^^^ value used here after move
187187

188188
error[E0382]: use of moved value: `rhs`
@@ -194,8 +194,8 @@ LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
194194
| consider adding a `Copy` constraint to this type argument
195195
LL | lhs ^ rhs;
196196
| --- value moved here
197-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
198-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
197+
LL | drop(lhs);
198+
LL | drop(rhs);
199199
| ^^^ value used here after move
200200

201201
error[E0382]: use of moved value: `lhs`
@@ -207,7 +207,7 @@ LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
207207
| consider adding a `Copy` constraint to this type argument
208208
LL | lhs << rhs;
209209
| --- value moved here
210-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
210+
LL | drop(lhs);
211211
| ^^^ value used here after move
212212

213213
error[E0382]: use of moved value: `rhs`
@@ -219,8 +219,8 @@ LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
219219
| consider adding a `Copy` constraint to this type argument
220220
LL | lhs << rhs;
221221
| --- value moved here
222-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
223-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
222+
LL | drop(lhs);
223+
LL | drop(rhs);
224224
| ^^^ value used here after move
225225

226226
error[E0382]: use of moved value: `lhs`
@@ -232,7 +232,7 @@ LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
232232
| consider adding a `Copy` constraint to this type argument
233233
LL | lhs >> rhs;
234234
| --- value moved here
235-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
235+
LL | drop(lhs);
236236
| ^^^ value used here after move
237237

238238
error[E0382]: use of moved value: `rhs`
@@ -244,8 +244,8 @@ LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
244244
| consider adding a `Copy` constraint to this type argument
245245
LL | lhs >> rhs;
246246
| --- value moved here
247-
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
248-
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
247+
LL | drop(lhs);
248+
LL | drop(rhs);
249249
| ^^^ value used here after move
250250

251251
error: aborting due to 20 previous errors

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | fn double_move<T: Add<Output=()>>(x: T) {
88
LL | x
99
| - value moved here
1010
LL | +
11-
LL | x; //~ ERROR: use of moved value
11+
LL | x;
1212
| ^ value used here after move
1313

1414
error[E0382]: borrow of moved value: `x`
@@ -21,7 +21,7 @@ LL | fn move_then_borrow<T: Add<Output=()> + Clone>(x: T) {
2121
LL | x
2222
| - value moved here
2323
LL | +
24-
LL | x.clone(); //~ ERROR: use of moved value
24+
LL | x.clone();
2525
| ^ value borrowed here after move
2626

2727
error[E0505]: cannot move out of `x` because it is borrowed
@@ -30,7 +30,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
3030
LL | let m = &x;
3131
| -- borrow of `x` occurs here
3232
...
33-
LL | x //~ ERROR: cannot move out of `x` because it is borrowed
33+
LL | x
3434
| ^ move out of `x` occurs here
3535
...
3636
LL | use_mut(n); use_imm(m);
@@ -42,21 +42,21 @@ error[E0505]: cannot move out of `y` because it is borrowed
4242
LL | let n = &mut y;
4343
| ------ borrow of `y` occurs here
4444
...
45-
LL | y; //~ ERROR: cannot move out of `y` because it is borrowed
45+
LL | y;
4646
| ^ move out of `y` occurs here
4747
LL | use_mut(n); use_imm(m);
4848
| - borrow later used here
4949

5050
error[E0507]: cannot move out of borrowed content
5151
--> $DIR/binop-move-semantics.rs:30:5
5252
|
53-
LL | *m //~ ERROR: cannot move out of borrowed content
53+
LL | *m
5454
| ^^ cannot move out of borrowed content
5555

5656
error[E0507]: cannot move out of borrowed content
5757
--> $DIR/binop-move-semantics.rs:32:5
5858
|
59-
LL | *n; //~ ERROR: cannot move out of borrowed content
59+
LL | *n;
6060
| ^^ cannot move out of borrowed content
6161

6262
error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
@@ -68,7 +68,7 @@ LL | &mut f
6868
| _____mutable borrow occurs here
6969
| |
7070
LL | | +
71-
LL | | &f; //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable
71+
LL | | &f;
7272
| | ^-
7373
| |_____||
7474
| |mutable borrow later used here
@@ -83,7 +83,7 @@ LL | &f
8383
| _____immutable borrow occurs here
8484
| |
8585
LL | | +
86-
LL | | &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable
86+
LL | | &mut f;
8787
| | ^^^^^-
8888
| |_____|____|
8989
| | immutable borrow later used here

0 commit comments

Comments
 (0)