Skip to content

Commit 40c1623

Browse files
committed
Auto merge of rust-lang#82639 - jyn514:stable-options, r=Mark-Simulacrum
Don't pass -Z unstable-options by default for UI tests Unconditionally passing -Z unstable-options makes it impossible to test whether an option requires unstable-options or not. This uncovered quite a lot of bugs, I'll open issues for each. These don't strictly need to be fixed before this is merged, it just makes the diff much larger because of the changes to diagnostics. - rust-lang#82636 - rust-lang#82637 - rust-lang#82638
2 parents 0279cb1 + 1cdc81b commit 40c1623

File tree

67 files changed

+86
-817
lines changed

Some content is hidden

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

67 files changed

+86
-817
lines changed

src/bootstrap/test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,6 @@ note: if you're sure you want to do this, please open an issue as to why. In the
12671267
}
12681268
}
12691269
flags.push(format!("-Cdebuginfo={}", builder.config.rust_debuginfo_level_tests));
1270-
flags.push("-Zunstable-options".to_string());
12711270
flags.push(builder.config.cmd.rustc_args().join(" "));
12721271

12731272
if let Some(linker) = builder.linker(target) {

src/test/rustdoc-ui/run-directory.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// revisions: correct incorrect
44
// check-pass
5-
// [correct]compile-flags:--test --test-run-directory={{src-base}}
6-
// [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage
5+
// [correct]compile-flags:--test --test-run-directory={{src-base}} -Zunstable-options
6+
// [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage -Zunstable-options
77
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
88
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
99

src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// compile-flags: -Z unstable-options
12
// NOTE: This test doesn't actually require `fulldeps`
23
// so we could instead use it as an `ui` test.
34
//

src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: passing `TyCtxt<'tcx>` by reference
2-
--> $DIR/pass_ty_by_ref_self.rs:17:15
2+
--> $DIR/pass_ty_by_ref_self.rs:18:15
33
|
44
LL | fn by_ref(&self) {}
55
| ^^^^^ help: try passing by value: `TyCtxt<'tcx>`
66
|
77
note: the lint level is defined here
8-
--> $DIR/pass_ty_by_ref_self.rs:7:9
8+
--> $DIR/pass_ty_by_ref_self.rs:8:9
99
|
1010
LL | #![deny(rustc::ty_pass_by_reference)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error: passing `Ty<'tcx>` by reference
14-
--> $DIR/pass_ty_by_ref_self.rs:30:21
14+
--> $DIR/pass_ty_by_ref_self.rs:31:21
1515
|
1616
LL | fn by_ref(self: &Ty<'tcx>) {}
1717
| ^^^^^^^^^ help: try passing by value: `Ty<'tcx>`

src/test/ui/annotate-snippet/missing-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --error-format human-annotate-rs
1+
// compile-flags: --error-format human-annotate-rs -Z unstable-options
22

33
pub fn main() {
44
let x: Iter; //~ ERROR cannot find type `Iter` in this scope

src/test/ui/annotate-snippet/multispan.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// aux-build:multispan.rs
2-
// compile-flags: --error-format human-annotate-rs
2+
// compile-flags: --error-format human-annotate-rs -Z unstable-options
33

44
#![feature(proc_macro_hygiene)]
55

src/test/ui/deduplicate-diagnostics.duplicate.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ error[E0452]: malformed lint attribute input
2222
LL | #[deny("literal")]
2323
| ^^^^^^^^^ bad attribute argument
2424

25-
error[E0452]: malformed lint attribute input
26-
--> $DIR/deduplicate-diagnostics.rs:8:8
27-
|
28-
LL | #[deny("literal")]
29-
| ^^^^^^^^^ bad attribute argument
30-
31-
error: aborting due to 5 previous errors
25+
error: aborting due to 4 previous errors
3226

3327
For more information about this error, try `rustc --explain E0452`.

src/test/ui/deduplicate-diagnostics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ struct S;
77

88
#[deny("literal")] //~ ERROR malformed lint attribute input
99
//[duplicate]~| ERROR malformed lint attribute input
10-
//[duplicate]~| ERROR malformed lint attribute input
1110
fn main() {}

src/test/ui/error-codes/E0452.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
//~| ERROR E0452
33
//~| ERROR E0452
44
//~| ERROR E0452
5-
//~| ERROR E0452
6-
//~| ERROR E0452
75
fn main() {
86
}

src/test/ui/error-codes/E0452.stderr

+1-13
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,6 @@ error[E0452]: malformed lint attribute input
2222
LL | #![allow(foo = "")]
2323
| ^^^^^^^^ bad attribute argument
2424

25-
error[E0452]: malformed lint attribute input
26-
--> $DIR/E0452.rs:1:10
27-
|
28-
LL | #![allow(foo = "")]
29-
| ^^^^^^^^ bad attribute argument
30-
31-
error[E0452]: malformed lint attribute input
32-
--> $DIR/E0452.rs:1:10
33-
|
34-
LL | #![allow(foo = "")]
35-
| ^^^^^^^^ bad attribute argument
36-
37-
error: aborting due to 6 previous errors
25+
error: aborting due to 4 previous errors
3826

3927
For more information about this error, try `rustc --explain E0452`.

src/test/ui/error-codes/E0453.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
#[allow(non_snake_case)]
44
//~^ ERROR allow(non_snake_case) incompatible
55
//~| ERROR allow(non_snake_case) incompatible
6-
//~| ERROR allow(non_snake_case) incompatible
76
fn main() {
87
}

src/test/ui/error-codes/E0453.stderr

+1-10
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ LL |
1616
LL | #[allow(non_snake_case)]
1717
| ^^^^^^^^^^^^^^ overruled by previous forbid
1818

19-
error[E0453]: allow(non_snake_case) incompatible with previous forbid
20-
--> $DIR/E0453.rs:3:9
21-
|
22-
LL | #![forbid(non_snake_case)]
23-
| -------------- `forbid` level set here
24-
LL |
25-
LL | #[allow(non_snake_case)]
26-
| ^^^^^^^^^^^^^^ overruled by previous forbid
27-
28-
error: aborting due to 3 previous errors
19+
error: aborting due to 2 previous errors
2920

3021
For more information about this error, try `rustc --explain E0453`.

src/test/ui/error-codes/E0602.stderr

+1-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ error[E0602]: unknown lint: `bogus`
66
|
77
= note: requested on the command line with `-D bogus`
88

9-
error[E0602]: unknown lint: `bogus`
10-
|
11-
= note: requested on the command line with `-D bogus`
12-
13-
error: aborting due to 3 previous errors
9+
error: aborting due to 2 previous errors
1410

1511
For more information about this error, try `rustc --explain E0602`.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![warn(nonstandard_style, reason = "the standard should be respected")]
22
//~^ ERROR lint reasons are experimental
33
//~| ERROR lint reasons are experimental
4-
//~| ERROR lint reasons are experimental
54

65
fn main() {}

src/test/ui/feature-gates/feature-gate-lint-reasons.stderr

+1-10
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
1616
= note: see issue #54503 <https://github.com/rust-lang/rust/issues/54503> for more information
1717
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable
1818

19-
error[E0658]: lint reasons are experimental
20-
--> $DIR/feature-gate-lint-reasons.rs:1:28
21-
|
22-
LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24-
|
25-
= note: see issue #54503 <https://github.com/rust-lang/rust/issues/54503> for more information
26-
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable
27-
28-
error: aborting due to 3 previous errors
19+
error: aborting due to 2 previous errors
2920

3021
For more information about this error, try `rustc --explain E0658`.

src/test/ui/lint/crate_level_only_lint.rs

-3
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@ mod foo {
44
#![allow(uncommon_codepoints)]
55
//~^ ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
66
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
7-
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
87

98
#[allow(uncommon_codepoints)]
109
//~^ ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
1110
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
12-
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
1311
const BAR: f64 = 0.000001;
1412

1513
}
1614

1715
#[allow(uncommon_codepoints)]
1816
//~^ ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
1917
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
20-
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
2118
fn main() {
2219
}

src/test/ui/lint/crate_level_only_lint.stderr

+5-23
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ LL | #![deny(uncommon_codepoints, unused_attributes)]
1111
| ^^^^^^^^^^^^^^^^^
1212

1313
error: allow(uncommon_codepoints) is ignored unless specified at crate level
14-
--> $DIR/crate_level_only_lint.rs:9:9
14+
--> $DIR/crate_level_only_lint.rs:8:9
1515
|
1616
LL | #[allow(uncommon_codepoints)]
1717
| ^^^^^^^^^^^^^^^^^^^
1818

1919
error: allow(uncommon_codepoints) is ignored unless specified at crate level
20-
--> $DIR/crate_level_only_lint.rs:17:9
20+
--> $DIR/crate_level_only_lint.rs:15:9
2121
|
2222
LL | #[allow(uncommon_codepoints)]
2323
| ^^^^^^^^^^^^^^^^^^^
@@ -29,34 +29,16 @@ LL | #![allow(uncommon_codepoints)]
2929
| ^^^^^^^^^^^^^^^^^^^
3030

3131
error: allow(uncommon_codepoints) is ignored unless specified at crate level
32-
--> $DIR/crate_level_only_lint.rs:9:9
32+
--> $DIR/crate_level_only_lint.rs:8:9
3333
|
3434
LL | #[allow(uncommon_codepoints)]
3535
| ^^^^^^^^^^^^^^^^^^^
3636

3737
error: allow(uncommon_codepoints) is ignored unless specified at crate level
38-
--> $DIR/crate_level_only_lint.rs:17:9
38+
--> $DIR/crate_level_only_lint.rs:15:9
3939
|
4040
LL | #[allow(uncommon_codepoints)]
4141
| ^^^^^^^^^^^^^^^^^^^
4242

43-
error: allow(uncommon_codepoints) is ignored unless specified at crate level
44-
--> $DIR/crate_level_only_lint.rs:4:10
45-
|
46-
LL | #![allow(uncommon_codepoints)]
47-
| ^^^^^^^^^^^^^^^^^^^
48-
49-
error: allow(uncommon_codepoints) is ignored unless specified at crate level
50-
--> $DIR/crate_level_only_lint.rs:9:9
51-
|
52-
LL | #[allow(uncommon_codepoints)]
53-
| ^^^^^^^^^^^^^^^^^^^
54-
55-
error: allow(uncommon_codepoints) is ignored unless specified at crate level
56-
--> $DIR/crate_level_only_lint.rs:17:9
57-
|
58-
LL | #[allow(uncommon_codepoints)]
59-
| ^^^^^^^^^^^^^^^^^^^
60-
61-
error: aborting due to 9 previous errors
43+
error: aborting due to 6 previous errors
6244

src/test/ui/lint/forbid-group-group-2.rs

-6
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,4 @@
1717
//~| WARNING previously accepted by the compiler
1818
//~| ERROR incompatible with previous
1919
//~| WARNING previously accepted by the compiler
20-
//~| ERROR incompatible with previous
21-
//~| WARNING previously accepted by the compiler
22-
//~| ERROR incompatible with previous
23-
//~| WARNING previously accepted by the compiler
24-
//~| ERROR incompatible with previous
25-
//~| WARNING previously accepted by the compiler
2620
fn main() {}

src/test/ui/lint/forbid-group-group-2.stderr

+1-37
Original file line numberDiff line numberDiff line change
@@ -75,41 +75,5 @@ LL | #[allow(nonstandard_style)]
7575
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7676
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
7777

78-
error: allow(nonstandard_style) incompatible with previous forbid
79-
--> $DIR/forbid-group-group-2.rs:7:9
80-
|
81-
LL | #![forbid(warnings)]
82-
| -------- `forbid` level set here
83-
...
84-
LL | #[allow(nonstandard_style)]
85-
| ^^^^^^^^^^^^^^^^^ overruled by previous forbid
86-
|
87-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
88-
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
89-
90-
error: allow(nonstandard_style) incompatible with previous forbid
91-
--> $DIR/forbid-group-group-2.rs:7:9
92-
|
93-
LL | #![forbid(warnings)]
94-
| -------- `forbid` level set here
95-
...
96-
LL | #[allow(nonstandard_style)]
97-
| ^^^^^^^^^^^^^^^^^ overruled by previous forbid
98-
|
99-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
100-
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
101-
102-
error: allow(nonstandard_style) incompatible with previous forbid
103-
--> $DIR/forbid-group-group-2.rs:7:9
104-
|
105-
LL | #![forbid(warnings)]
106-
| -------- `forbid` level set here
107-
...
108-
LL | #[allow(nonstandard_style)]
109-
| ^^^^^^^^^^^^^^^^^ overruled by previous forbid
110-
|
111-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
112-
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
113-
114-
error: aborting due to 9 previous errors
78+
error: aborting due to 6 previous errors
11579

src/test/ui/lint/forbid-group-member.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
//~| WARNING previously accepted
1313
//~| WARNING incompatible with previous forbid
1414
//~| WARNING previously accepted
15-
//~| WARNING incompatible with previous forbid
16-
//~| WARNING previously accepted
1715
fn main() {
1816
let a: ();
1917
}

src/test/ui/lint/forbid-group-member.stderr

+1-13
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,5 @@ LL | #[allow(unused_variables)]
3535
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
3636
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
3737

38-
warning: allow(unused_variables) incompatible with previous forbid
39-
--> $DIR/forbid-group-member.rs:8:9
40-
|
41-
LL | #![forbid(unused)]
42-
| ------ `forbid` level set here
43-
LL |
44-
LL | #[allow(unused_variables)]
45-
| ^^^^^^^^^^^^^^^^ overruled by previous forbid
46-
|
47-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
48-
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
49-
50-
warning: 4 warnings emitted
38+
warning: 3 warnings emitted
5139

src/test/ui/lint/forbid-member-group.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#[allow(unused)]
77
//~^ ERROR incompatible with previous forbid
88
//~| ERROR incompatible with previous forbid
9-
//~| ERROR incompatible with previous forbid
109
fn main() {
1110
let a: ();
1211
}

src/test/ui/lint/forbid-member-group.stderr

+1-10
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ LL |
1616
LL | #[allow(unused)]
1717
| ^^^^^^ overruled by previous forbid
1818

19-
error[E0453]: allow(unused) incompatible with previous forbid
20-
--> $DIR/forbid-member-group.rs:6:9
21-
|
22-
LL | #![forbid(unused_variables)]
23-
| ---------------- `forbid` level set here
24-
LL |
25-
LL | #[allow(unused)]
26-
| ^^^^^^ overruled by previous forbid
27-
28-
error: aborting due to 3 previous errors
19+
error: aborting due to 2 previous errors
2920

3021
For more information about this error, try `rustc --explain E0453`.

src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns elided_lifetimes_in_paths
1+
// compile-flags: --force-warns elided_lifetimes_in_paths -Zunstable-options
22
// check-pass
33

44
struct Foo<'a> {

src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns const_err
1+
// compile-flags: --force-warns const_err -Zunstable-options
22
// check-pass
33

44
#![allow(const_err)]

src/test/ui/lint/force-warn/force-allowed-warning.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns dead_code
1+
// compile-flags: --force-warns dead_code -Zunstable-options
22
// check-pass
33

44
#![allow(dead_code)]

src/test/ui/lint/force-warn/force-deny-by-default-lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns const_err
1+
// compile-flags: --force-warns const_err -Zunstable-options
22
// check-pass
33

44
const C: i32 = 1 / 0;

src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns dead_code
1+
// compile-flags: --force-warns dead_code -Zunstable-options
22
// check-pass
33

44
#![allow(warnings)]

src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns nonstandard_style
1+
// compile-flags: --force-warns nonstandard_style -Zunstable-options
22
// check-pass
33

44
#![allow(warnings)]

src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns bare_trait_objects
1+
// compile-flags: --force-warns bare_trait_objects -Zunstable-options
22
// check-pass
33

44
#![allow(rust_2018_idioms)]

src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns rust_2018_idioms
1+
// compile-flags: --force-warns rust_2018_idioms -Zunstable-options
22
// check-pass
33

44
#![allow(bare_trait_objects)]

0 commit comments

Comments
 (0)