Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 14d56e8

Browse files
committed
Fix test problems discovered by the revision check
Most of these changes either add revision names that were apparently missing, or explicitly mark a revision name as currently unused.
1 parent be590d3 commit 14d56e8

26 files changed

+87
-41
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: fatal error triggered by #[rustc_error]
2+
--> $DIR/bound-lifetime-constrained.rs:48:1
3+
|
4+
LL | fn main() { }
5+
| ^^^^^^^^^
6+
7+
error: aborting due to 1 previous error
8+

tests/ui/associated-types/bound-lifetime-constrained.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ revisions: func object clause
1+
//@ revisions: func object clause ok
22

33
#![allow(dead_code)]
44
#![feature(rustc_attrs)]

tests/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
2-
--> $DIR/two-phase-activation-sharing-interference.rs:28:15
2+
--> $DIR/two-phase-activation-sharing-interference.rs:29:15
33
|
44
LL | let y = &mut x;
55
| ------ mutable borrow occurs here
@@ -10,7 +10,7 @@ LL | *y += 1;
1010
| ------- mutable borrow later used here
1111

1212
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
13-
--> $DIR/two-phase-activation-sharing-interference.rs:36:13
13+
--> $DIR/two-phase-activation-sharing-interference.rs:37:13
1414
|
1515
LL | let y = &mut x;
1616
| ------ mutable borrow occurs here
@@ -32,7 +32,7 @@ LL | *y += 1;
3232
| ------- mutable borrow later used here
3333

3434
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
35-
--> $DIR/two-phase-activation-sharing-interference.rs:58:14
35+
--> $DIR/two-phase-activation-sharing-interference.rs:56:14
3636
|
3737
LL | let y = &mut x;
3838
| ------ mutable borrow occurs here

tests/ui/borrowck/two-phase-activation-sharing-interference.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: nll_target
22

33
// The following revisions are disabled due to missing support from two-phase beyond autorefs
4+
//@ unused-revision-names: nll_beyond
45
//@[nll_beyond] compile-flags: -Z two-phase-beyond-autoref
56

67
// This is an important corner case pointed out by Niko: one is
@@ -36,8 +37,7 @@ fn not_ok() {
3637
let z = &x;
3738
//[nll_target]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
3839
*y += 1;
39-
//[lxl_beyond]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable
40-
//[nll_beyond]~^^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable
40+
//[nll_beyond]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable
4141
read(z);
4242
}
4343

@@ -48,8 +48,6 @@ fn should_be_ok_with_nll() {
4848
//[nll_target]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
4949
read(z);
5050
*y += 1;
51-
//[lxl_beyond]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable
52-
// (okay with (generalized) nll today)
5351
}
5452

5553
fn should_also_eventually_be_ok_with_nll() {
@@ -58,8 +56,6 @@ fn should_also_eventually_be_ok_with_nll() {
5856
let _z = &x;
5957
//[nll_target]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
6058
*y += 1;
61-
//[lxl_beyond]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable
62-
// (okay with (generalized) nll today)
6359
}
6460

6561
fn main() { }

tests/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0503]: cannot use `i` because it was mutably borrowed
2-
--> $DIR/two-phase-allow-access-during-reservation.rs:26:19
2+
--> $DIR/two-phase-allow-access-during-reservation.rs:27:19
33
|
44
LL | /*1*/ let p = &mut i; // (reservation of `i` starts here)
55
| ------ `i` is borrowed here
@@ -11,7 +11,7 @@ LL | /*3*/ *p += 1; // (mutable borrow of `i` starts here, since `p`
1111
| ------- borrow later used here
1212

1313
error[E0503]: cannot use `i` because it was mutably borrowed
14-
--> $DIR/two-phase-allow-access-during-reservation.rs:31:19
14+
--> $DIR/two-phase-allow-access-during-reservation.rs:32:19
1515
|
1616
LL | /*1*/ let p = &mut i; // (reservation of `i` starts here)
1717
| ------ `i` is borrowed here

tests/ui/borrowck/two-phase-allow-access-during-reservation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: nll_target
22

33
// The following revisions are disabled due to missing support for two_phase_beyond_autoref
4+
//@ unused-revision-names: nll_beyond
45
//@[nll_beyond] compile-flags: -Z two_phase_beyond_autoref
56

67
// This is the second counter-example from Niko's blog post

tests/ui/borrowck/two-phase-nonrecv-autoref.base.stderr

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0499]: cannot borrow `*f` as mutable more than once at a time
2-
--> $DIR/two-phase-nonrecv-autoref.rs:50:11
2+
--> $DIR/two-phase-nonrecv-autoref.rs:51:11
33
|
44
LL | f(f(10));
55
| - ^ second mutable borrow occurs here
@@ -8,7 +8,7 @@ LL | f(f(10));
88
| first borrow later used by call
99

1010
error[E0382]: use of moved value: `f`
11-
--> $DIR/two-phase-nonrecv-autoref.rs:57:11
11+
--> $DIR/two-phase-nonrecv-autoref.rs:58:11
1212
|
1313
LL | fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {
1414
| - move occurs because `f` has type `Box<F>`, which does not implement the `Copy` trait
@@ -18,7 +18,7 @@ LL | f(f(10));
1818
| value moved here
1919

2020
error[E0499]: cannot borrow `*f` as mutable more than once at a time
21-
--> $DIR/two-phase-nonrecv-autoref.rs:62:11
21+
--> $DIR/two-phase-nonrecv-autoref.rs:63:11
2222
|
2323
LL | f(f(10));
2424
| - ^ second mutable borrow occurs here
@@ -27,7 +27,7 @@ LL | f(f(10));
2727
| first borrow later used by call
2828

2929
error[E0382]: use of moved value: `f`
30-
--> $DIR/two-phase-nonrecv-autoref.rs:69:11
30+
--> $DIR/two-phase-nonrecv-autoref.rs:70:11
3131
|
3232
LL | fn twice_ten_oo(f: Box<dyn FnOnce(i32) -> i32>) {
3333
| - move occurs because `f` has type `Box<dyn FnOnce(i32) -> i32>`, which does not implement the `Copy` trait
@@ -37,7 +37,7 @@ LL | f(f(10));
3737
| value moved here
3838

3939
error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
40-
--> $DIR/two-phase-nonrecv-autoref.rs:107:27
40+
--> $DIR/two-phase-nonrecv-autoref.rs:108:27
4141
|
4242
LL | double_access(&mut a, &a);
4343
| ------------- ------ ^^ immutable borrow occurs here
@@ -46,7 +46,7 @@ LL | double_access(&mut a, &a);
4646
| mutable borrow later used by call
4747

4848
error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
49-
--> $DIR/two-phase-nonrecv-autoref.rs:132:7
49+
--> $DIR/two-phase-nonrecv-autoref.rs:133:7
5050
|
5151
LL | i[i[3]] = 4;
5252
| --^----
@@ -56,18 +56,18 @@ LL | i[i[3]] = 4;
5656
| mutable borrow occurs here
5757
|
5858
help: try adding a local storing this...
59-
--> $DIR/two-phase-nonrecv-autoref.rs:132:8
59+
--> $DIR/two-phase-nonrecv-autoref.rs:133:8
6060
|
6161
LL | i[i[3]] = 4;
6262
| ^^^
6363
help: ...and then using that local here
64-
--> $DIR/two-phase-nonrecv-autoref.rs:132:6
64+
--> $DIR/two-phase-nonrecv-autoref.rs:133:6
6565
|
6666
LL | i[i[3]] = 4;
6767
| ^^^^^^
6868

6969
error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
70-
--> $DIR/two-phase-nonrecv-autoref.rs:138:7
70+
--> $DIR/two-phase-nonrecv-autoref.rs:139:7
7171
|
7272
LL | i[i[3]] = i[4];
7373
| --^----
@@ -77,12 +77,12 @@ LL | i[i[3]] = i[4];
7777
| mutable borrow occurs here
7878
|
7979
help: try adding a local storing this...
80-
--> $DIR/two-phase-nonrecv-autoref.rs:138:8
80+
--> $DIR/two-phase-nonrecv-autoref.rs:139:8
8181
|
8282
LL | i[i[3]] = i[4];
8383
| ^^^
8484
help: ...and then using that local here
85-
--> $DIR/two-phase-nonrecv-autoref.rs:138:6
85+
--> $DIR/two-phase-nonrecv-autoref.rs:139:6
8686
|
8787
LL | i[i[3]] = i[4];
8888
| ^^^^^^

tests/ui/borrowck/two-phase-nonrecv-autoref.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ revisions: base
22

3+
//@ unused-revision-names: g2p
34
//@[g2p]compile-flags: -Z two-phase-beyond-autoref
45
// the above revision is disabled until two-phase-beyond-autoref support is better
56

tests/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable
2-
--> $DIR/two-phase-reservation-sharing-interference.rs:32:17
2+
--> $DIR/two-phase-reservation-sharing-interference.rs:33:17
33
|
44
LL | let shared = &vec;
55
| ---- immutable borrow occurs here

tests/ui/borrowck/two-phase-reservation-sharing-interference.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: nll_target
22

33
// The nll_beyond revision is disabled due to missing support from two-phase beyond autorefs
4+
//@ unused-revision-names: nll_beyond
45
//@[nll_beyond]compile-flags: -Z two-phase-beyond-autoref
56
//@[nll_beyond]should-fail
67

0 commit comments

Comments
 (0)