Skip to content

Commit 87ce5ec

Browse files
committed
Update compare-mode=nll stderr files to reflect the fix to #55492.
1 parent d5798c9 commit 87ce5ec

6 files changed

+18
-65
lines changed

src/test/ui/borrowck/borrowck-closures-unique.nll.stderr

+2-6
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,15 @@ LL | let c2 = || set(x); //~ ERROR two closures require unique access to `x`
4040
LL | c1;
4141
| -- first borrow later used here
4242

43-
warning[E0594]: cannot assign to `x`, as it is not declared as mutable
43+
error[E0594]: cannot assign to `x`, as it is not declared as mutable
4444
--> $DIR/borrowck-closures-unique.rs:57:38
4545
|
4646
LL | fn e(x: &'static mut isize) {
4747
| - help: consider changing this to be mutable: `mut x`
4848
LL | let c1 = |y: &'static mut isize| x = y; //~ ERROR closure cannot assign to immutable argument
4949
| ^^^^^ cannot assign
50-
|
51-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
52-
It represents potential unsoundness in your code.
53-
This warning will become a hard error in the future.
5450

55-
error: aborting due to 3 previous errors
51+
error: aborting due to 4 previous errors
5652

5753
Some errors occurred: E0500, E0524, E0594.
5854
For more information about an error, try `rustc --explain E0500`.

src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than o
2020
LL | *y = 1;
2121
| ------ first borrow later used here
2222

23-
warning: captured variable cannot escape `FnMut` closure body
23+
error: captured variable cannot escape `FnMut` closure body
2424
--> $DIR/borrowck-describe-lvalue.rs:305:16
2525
|
2626
LL | || {
@@ -36,9 +36,6 @@ LL | | }
3636
|
3737
= note: `FnMut` closures only have access to their captured variables while they are executing...
3838
= note: ...therefore, they cannot allow references to captured variables to escape
39-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
40-
It represents potential unsoundness in your code.
41-
This warning will become a hard error in the future.
4239

4340
error[E0503]: cannot use `f.x` because it was mutably borrowed
4441
--> $DIR/borrowck-describe-lvalue.rs:53:9
@@ -382,7 +379,7 @@ LL | drop(x); //[ast]~ ERROR use of moved value: `x`
382379
|
383380
= note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
384381

385-
error: aborting due to 29 previous errors
382+
error: aborting due to 30 previous errors
386383

387384
Some errors occurred: E0382, E0499, E0502, E0503.
388385
For more information about an error, try `rustc --explain E0382`.

src/test/ui/borrowck/mutability-errors.nll.stderr

+5-21
Original file line numberDiff line numberDiff line change
@@ -277,57 +277,41 @@ LL | &mut x; //~ ERROR
277277
LL | &mut x.0; //~ ERROR
278278
| ^^^^^^^^ cannot borrow as mutable
279279

280-
warning[E0594]: cannot assign to `x`, as it is not declared as mutable
280+
error[E0594]: cannot assign to `x`, as it is not declared as mutable
281281
--> $DIR/mutability-errors.rs:70:9
282282
|
283283
LL | fn imm_capture(x: (i32,)) {
284284
| - help: consider changing this to be mutable: `mut x`
285285
LL | || { //~ ERROR
286286
LL | x = (1,);
287287
| ^^^^^^^^ cannot assign
288-
|
289-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
290-
It represents potential unsoundness in your code.
291-
This warning will become a hard error in the future.
292288

293-
warning[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
289+
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
294290
--> $DIR/mutability-errors.rs:71:9
295291
|
296292
LL | fn imm_capture(x: (i32,)) {
297293
| - help: consider changing this to be mutable: `mut x`
298294
...
299295
LL | x.0 = 1;
300296
| ^^^^^^^ cannot assign
301-
|
302-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
303-
It represents potential unsoundness in your code.
304-
This warning will become a hard error in the future.
305297

306-
warning[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
298+
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
307299
--> $DIR/mutability-errors.rs:72:9
308300
|
309301
LL | fn imm_capture(x: (i32,)) {
310302
| - help: consider changing this to be mutable: `mut x`
311303
...
312304
LL | &mut x;
313305
| ^^^^^^ cannot borrow as mutable
314-
|
315-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
316-
It represents potential unsoundness in your code.
317-
This warning will become a hard error in the future.
318306

319-
warning[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
307+
error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
320308
--> $DIR/mutability-errors.rs:73:9
321309
|
322310
LL | fn imm_capture(x: (i32,)) {
323311
| - help: consider changing this to be mutable: `mut x`
324312
...
325313
LL | &mut x.0;
326314
| ^^^^^^^^ cannot borrow as mutable
327-
|
328-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
329-
It represents potential unsoundness in your code.
330-
This warning will become a hard error in the future.
331315

332316
error[E0594]: cannot assign to `x`, as it is not declared as mutable
333317
--> $DIR/mutability-errors.rs:76:9
@@ -389,7 +373,7 @@ error[E0596]: cannot borrow `X.0` as mutable, as `X` is an immutable static item
389373
LL | &mut X.0; //~ ERROR
390374
| ^^^^^^^^ cannot borrow as mutable
391375

392-
error: aborting due to 34 previous errors
376+
error: aborting due to 38 previous errors
393377

394378
Some errors occurred: E0594, E0596.
395379
For more information about an error, try `rustc --explain E0594`.

src/test/ui/unboxed-closures/unboxed-closure-immutable-capture.nll.stderr

+5-21
Original file line numberDiff line numberDiff line change
@@ -33,59 +33,43 @@ LL | let x = 0;
3333
LL | move || set(&mut x); //~ ERROR cannot borrow
3434
| ^^^^^^ cannot borrow as mutable
3535

36-
warning[E0594]: cannot assign to `x`, as it is not declared as mutable
36+
error[E0594]: cannot assign to `x`, as it is not declared as mutable
3737
--> $DIR/unboxed-closure-immutable-capture.rs:23:8
3838
|
3939
LL | let x = 0;
4040
| - help: consider changing this to be mutable: `mut x`
4141
...
4242
LL | || x = 1; //~ ERROR cannot assign
4343
| ^^^^^ cannot assign
44-
|
45-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
46-
It represents potential unsoundness in your code.
47-
This warning will become a hard error in the future.
4844

49-
warning[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
45+
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
5046
--> $DIR/unboxed-closure-immutable-capture.rs:25:12
5147
|
5248
LL | let x = 0;
5349
| - help: consider changing this to be mutable: `mut x`
5450
...
5551
LL | || set(&mut x); //~ ERROR cannot assign
5652
| ^^^^^^ cannot borrow as mutable
57-
|
58-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
59-
It represents potential unsoundness in your code.
60-
This warning will become a hard error in the future.
6153

62-
warning[E0594]: cannot assign to `x`, as it is not declared as mutable
54+
error[E0594]: cannot assign to `x`, as it is not declared as mutable
6355
--> $DIR/unboxed-closure-immutable-capture.rs:26:8
6456
|
6557
LL | let x = 0;
6658
| - help: consider changing this to be mutable: `mut x`
6759
...
6860
LL | || x = 1; //~ ERROR cannot assign
6961
| ^^^^^ cannot assign
70-
|
71-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
72-
It represents potential unsoundness in your code.
73-
This warning will become a hard error in the future.
7462

75-
warning[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
63+
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
7664
--> $DIR/unboxed-closure-immutable-capture.rs:28:12
7765
|
7866
LL | let x = 0;
7967
| - help: consider changing this to be mutable: `mut x`
8068
...
8169
LL | || set(&mut x); //~ ERROR cannot assign
8270
| ^^^^^^ cannot borrow as mutable
83-
|
84-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
85-
It represents potential unsoundness in your code.
86-
This warning will become a hard error in the future.
8771

88-
error: aborting due to 4 previous errors
72+
error: aborting due to 8 previous errors
8973

9074
Some errors occurred: E0594, E0596.
9175
For more information about an error, try `rustc --explain E0594`.
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
warning[E0596]: cannot borrow `tick1` as mutable, as it is not declared as mutable
1+
error[E0596]: cannot borrow `tick1` as mutable, as it is not declared as mutable
22
--> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:27:9
33
|
44
LL | let tick1 = || {
55
| ----- help: consider changing this to be mutable: `mut tick1`
66
...
77
LL | tick1();
88
| ^^^^^ cannot borrow as mutable
9-
|
10-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
11-
It represents potential unsoundness in your code.
12-
This warning will become a hard error in the future.
139

1410
error[E0596]: cannot borrow `tick2` as mutable, as it is not declared as mutable
1511
--> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:30:5
@@ -20,6 +16,6 @@ LL | let tick2 = || { //~ ERROR closure cannot assign to immutable local var
2016
LL | tick2(); //~ ERROR cannot borrow
2117
| ^^^^^ cannot borrow as mutable
2218

23-
error: aborting due to previous error
19+
error: aborting due to 2 previous errors
2420

2521
For more information about this error, try `rustc --explain E0596`.

src/test/ui/unboxed-closures/unboxed-closures-mutate-upvar.nll.stderr

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
warning[E0594]: cannot assign to `n`, as it is not declared as mutable
1+
error[E0594]: cannot assign to `n`, as it is not declared as mutable
22
--> $DIR/unboxed-closures-mutate-upvar.rs:25:9
33
|
44
LL | let n = 0;
55
| - help: consider changing this to be mutable: `mut n`
66
LL | let mut f = to_fn_mut(|| { //~ ERROR closure cannot assign
77
LL | n += 1;
88
| ^^^^^^ cannot assign
9-
|
10-
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
11-
It represents potential unsoundness in your code.
12-
This warning will become a hard error in the future.
139

1410
error[E0594]: cannot assign to `n`, as it is not declared as mutable
1511
--> $DIR/unboxed-closures-mutate-upvar.rs:42:9
@@ -44,6 +40,6 @@ LL | | n += 1; //~ ERROR cannot assign
4440
LL | | });
4541
| |_____^
4642

47-
error: aborting due to 3 previous errors
43+
error: aborting due to 4 previous errors
4844

4945
For more information about this error, try `rustc --explain E0594`.

0 commit comments

Comments
 (0)