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

tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ LL | #[cfg(feature = "unk")]
3030
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
3131

3232
warning: unexpected `cfg` condition name: `feature`
33-
--> $DIR/exhaustive-names-values.rs:25:7
33+
--> $DIR/exhaustive-names-values.rs:24:7
3434
|
3535
LL | #[cfg(feature = "std")]
3636
| ^^^^^^^^^^^^^^^

tests/ui/check-cfg/exhaustive-names-values.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ pub fn f() {}
1616
pub fn f() {}
1717

1818
#[cfg(feature = "unk")]
19-
//[empty_names_values]~^ WARNING unexpected `cfg` condition name
20-
//[empty_cfg]~^^ WARNING unexpected `cfg` condition name
21-
//[feature]~^^^ WARNING unexpected `cfg` condition value
22-
//[full]~^^^^ WARNING unexpected `cfg` condition value
19+
//[empty_cfg]~^ WARNING unexpected `cfg` condition name
20+
//[feature]~^^ WARNING unexpected `cfg` condition value
21+
//[full]~^^^ WARNING unexpected `cfg` condition value
2322
pub fn feat() {}
2423

2524
#[cfg(feature = "std")]
26-
//[empty_names_values]~^ WARNING unexpected `cfg` condition name
27-
//[empty_cfg]~^^ WARNING unexpected `cfg` condition name
25+
//[empty_cfg]~^ WARNING unexpected `cfg` condition name
2826
pub fn feat() {}
2927

3028
#[cfg(windows)]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
warning: unexpected `cfg` condition value: `bar`
2+
--> $DIR/values-none.rs:16:7
3+
|
4+
LL | #[cfg(foo = "bar")]
5+
| ^^^^^^^^^^^
6+
|
7+
= note: expected values for `foo` are: (none), `too`
8+
= help: to expect this configuration use `--check-cfg=cfg(foo, values("bar"))`
9+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
10+
= note: `#[warn(unexpected_cfgs)]` on by default
11+
12+
warning: 1 warning emitted
13+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
warning: unexpected `cfg` condition value: `bar`
2+
--> $DIR/values-none.rs:16:7
3+
|
4+
LL | #[cfg(foo = "bar")]
5+
| ^^^^^^^^^^^
6+
|
7+
= note: expected values for `foo` are: (none), `too`
8+
= help: to expect this configuration use `--check-cfg=cfg(foo, values("bar"))`
9+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
10+
= note: `#[warn(unexpected_cfgs)]` on by default
11+
12+
warning: 1 warning emitted
13+

tests/ui/check-cfg/values-none.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ check-pass
22
//
33
//@ no-auto-check-cfg
4-
//@ revisions: explicit implicit
4+
//@ revisions: explicit implicit simple concat_1 concat_2
55
//@ [explicit]compile-flags: --check-cfg=cfg(foo,values(none()))
66
//@ [implicit]compile-flags: --check-cfg=cfg(foo)
77
//@ [simple] compile-flags: --check-cfg=cfg(foo,values(none(),"too"))
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
warning: unexpected `cfg` condition value: `bar`
2+
--> $DIR/values-none.rs:16:7
3+
|
4+
LL | #[cfg(foo = "bar")]
5+
| ^^^^^^^^^^^
6+
|
7+
= note: expected values for `foo` are: (none), `too`
8+
= help: to expect this configuration use `--check-cfg=cfg(foo, values("bar"))`
9+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
10+
= note: `#[warn(unexpected_cfgs)]` on by default
11+
12+
warning: 1 warning emitted
13+

tests/ui/dyn-star/param-env-region-infer.current.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0282]: type annotations needed
2-
--> $DIR/param-env-region-infer.rs:19:10
2+
--> $DIR/param-env-region-infer.rs:20:10
33
|
44
LL | t as _
55
| ^ cannot infer type

tests/ui/dyn-star/param-env-region-infer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
//@ revisions: current
22
//@ incremental
33

4-
// FIXME(-Znext-solver): THis currently results in unstable query results:
4+
// FIXME(-Znext-solver): This currently results in unstable query results:
55
// `normalizes-to(opaque, opaque)` changes from `Maybe(Ambiguous)` to `Maybe(Overflow)`
66
// once the hidden type of the opaque is already defined to be itself.
7+
//@ unused-revision-names: next
78

89
// checks that we don't ICE if there are region inference variables in the environment
910
// when computing `PointerLike` builtin candidates.

tests/ui/instrument-coverage/coverage-options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ needs-profiler-support
2-
//@ revisions: block branch bad
2+
//@ revisions: block branch mcdc bad
33
//@ compile-flags -Cinstrument-coverage
44

55
//@ [block] check-pass

tests/ui/meta/meta-expected-error-wrong-rev.a.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/meta-expected-error-wrong-rev.rs:13:18
2+
--> $DIR/meta-expected-error-wrong-rev.rs:14:18
33
|
44
LL | let x: u32 = 22_usize;
55
| --- ^^^^^^^^ expected `u32`, found `usize`

tests/ui/meta/meta-expected-error-wrong-rev.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ ignore-compare-mode-polonius
22

33
//@ revisions: a
4+
//@ unused-revision-names: b
45
//@ should-fail
56

67
// This is a "meta-test" of the compilertest framework itself. In

tests/ui/methods/method-lookup-order.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// {mutbar_for_foo, valbar_for_etmut_foo} (which are lower precedent than the inherent `&mut self` method on `Foo`; e.g. b10101 *is* included.
1818

1919
//@ revisions: b00001 b00010 b00011 b00100 b00101 b00110 b00111 b01000 b01001 b01100 b01101 b10000 b10001 b10010 b10011 b10101 b10111 b11000 b11001 b11101
20+
//@ unused-revision-names: b01010 b01011 b01110 b01111 b10100 b10110 b11010 b11011 b11100 b11110 b11111
2021

2122
//@ compile-flags: --check-cfg=cfg(inherent_mut,bar_for_foo,mutbar_for_foo)
2223
//@ compile-flags: --check-cfg=cfg(valbar_for_et_foo,valbar_for_etmut_foo)

tests/ui/target-feature/tied-features-cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ revisions: one two three
1+
//@ revisions: one two three four
22
//@ compile-flags: --crate-type=rlib --target=aarch64-unknown-linux-gnu
33
//@ needs-llvm-components: aarch64
44
//

tests/ui/transmutability/primitives/bool-mut.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ check-fail
2-
//@[next] compile-flags: -Znext-solver
32

43
#![feature(transmutability)]
54
mod assert {

tests/ui/transmutability/primitives/bool-mut.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: `u8` cannot be safely transmuted into `bool`
2-
--> $DIR/bool-mut.rs:15:50
2+
--> $DIR/bool-mut.rs:14:50
33
|
44
LL | assert::is_transmutable::<&'static mut bool, &'static mut u8>()
55
| ^^^^^^^^^^^^^^^ at least one value of `u8` isn't a bit-valid value of `bool`
66
|
77
note: required by a bound in `is_transmutable`
8-
--> $DIR/bool-mut.rs:10:14
8+
--> $DIR/bool-mut.rs:9:14
99
|
1010
LL | pub fn is_transmutable<Src, Dst>()
1111
| --------------- required by a bound in this function

tests/ui/version/version-info-flags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
//@ check-pass
55
//@[version] compile-flags: -V
66
//@[verbose-version] compile-flags: -vV
7-
//@[long-verbose-verison] compile-flags: --version --verbose
7+
//@[long-verbose-version] compile-flags: --version --verbose
88

99
fn main() {}

0 commit comments

Comments
 (0)