Skip to content

Commit 7ee926a

Browse files
authored
Rollup merge of #90554 - ehuss:unstable-options-cleanup, r=joshtriplett
Clean up some `-Z unstable-options` in tests. Several of these tests were for features that have been stabilized, or otherwise don't need `-Z unstable-options`.
2 parents 6964ec2 + 754455e commit 7ee926a

22 files changed

+27
-38
lines changed

src/test/ui/hello2021.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// edition:2021
3-
// compile-flags: -Zunstable-options
43

54
fn main() {
65
println!("hello, 2021");

src/test/ui/iterators/into-iter-on-arrays-2021.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// check-pass
22
// edition:2021
3-
// compile-flags: -Zunstable-options
43

54
use std::array::IntoIter;
65
use std::ops::Deref;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
22
// despite $LINT being allowed on command line
3-
// compile-flags: -A const_err --force-warn const_err -Zunstable-options
3+
// compile-flags: -A const_err --force-warn const_err
44
// check-pass
55

66
const C: i32 = 1 / 0;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --force-warn $LINT_GROUP causes $LINT (which is warn-by-default) to warn
22
// despite $LINT being allowed on command line
3-
// compile-flags: -A bare-trait-objects --force-warn rust-2018-idioms -Zunstable-options
3+
// compile-flags: -A bare-trait-objects --force-warn rust-2018-idioms
44
// check-pass
55

66
pub trait SomeTrait {}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --force-warn $LINT causes $LINT (which is warn-by-default) to warn
22
// despite being allowed in one submodule (but not the other)
3-
// compile-flags: --force-warn dead_code -Zunstable-options
3+
// compile-flags: --force-warn dead_code
44
// check-pass
55

66
mod one {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// --force-warn warnings is an error
2-
// compile-flags: --force-warn warnings -Zunstable-options
2+
// compile-flags: --force-warn warnings
33
// error-pattern: `warnings` lint group is not supported
44

55
fn main() {}

src/test/ui/lint/force-warn/warnings-lint-group.stderr

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ error[E0602]: `warnings` lint group is not supported with ´--force-warn´
22

33
error[E0602]: `warnings` lint group is not supported with ´--force-warn´
44

5-
error[E0602]: `warnings` lint group is not supported with ´--force-warn´
6-
7-
error: aborting due to 3 previous errors
5+
error: aborting due to 2 previous errors
86

97
For more information about this error, try `rustc --explain E0602`.

src/test/ui/lint/unused_parens_json_suggestion.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --error-format json -Zunstable-options
1+
// compile-flags: --error-format json
22
// run-rustfix
33

44
// The output for humans should just highlight the whole span without showing

src/test/ui/lint/unused_parens_json_suggestion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --error-format json -Zunstable-options
1+
// compile-flags: --error-format json
22
// run-rustfix
33

44
// The output for humans should just highlight the whole span without showing

src/test/ui/lint/unused_parens_json_suggestion.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"message":"unnecessary parentheses around assigned value","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":596,"byte_end":597,"line_start":16,"line_end":16,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));
1+
{"message":"unnecessary parentheses around assigned value","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":577,"byte_end":578,"line_start":16,"line_end":16,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));
22
--> $DIR/unused_parens_json_suggestion.rs:16:14
33
|
44
LL | let _a = (1 / (2 + 3));

src/test/ui/lint/unused_parens_remove_json_suggestion.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --error-format json -Zunstable-options
1+
// compile-flags: --error-format json
22
// run-rustfix
33

44
// The output for humans should just highlight the whole span without showing

src/test/ui/lint/unused_parens_remove_json_suggestion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --error-format json -Zunstable-options
1+
// compile-flags: --error-format json
22
// run-rustfix
33

44
// The output for humans should just highlight the whole span without showing

src/test/ui/lint/unused_parens_remove_json_suggestion.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":500,"byte_end":501,"line_start":17,"line_end":17,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (_b) {
1+
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":481,"byte_end":482,"line_start":17,"line_end":17,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (_b) {
22
--> $DIR/unused_parens_remove_json_suggestion.rs:17:8
33
|
44
LL | if (_b) {
@@ -16,7 +16,7 @@ LL + if _b {
1616
|
1717

1818
"}
19-
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":631,"byte_end":632,"line_start":28,"line_end":28,"column_start":7,"column_end":8,"is_primary":true,"text":[{"text":" if(c) {
19+
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":612,"byte_end":613,"line_start":28,"line_end":28,"column_start":7,"column_end":8,"is_primary":true,"text":[{"text":" if(c) {
2020
--> $DIR/unused_parens_remove_json_suggestion.rs:28:7
2121
|
2222
LL | if(c) {
@@ -29,7 +29,7 @@ LL + if c {
2929
|
3030

3131
"}
32-
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":711,"byte_end":712,"line_start":32,"line_end":32,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (c){
32+
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":692,"byte_end":693,"line_start":32,"line_end":32,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (c){
3333
--> $DIR/unused_parens_remove_json_suggestion.rs:32:8
3434
|
3535
LL | if (c){
@@ -42,7 +42,7 @@ LL + if c {
4242
|
4343

4444
"}
45-
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":793,"byte_end":794,"line_start":36,"line_end":36,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":807,"byte_end":808,"line_start":36,"line_end":36,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":793,"byte_end":794,"line_start":36,"line_end":36,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":807,"byte_end":808,"line_start":36,"line_end":36,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":" ","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `while` condition
45+
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":774,"byte_end":775,"line_start":36,"line_end":36,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":788,"byte_end":789,"line_start":36,"line_end":36,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":774,"byte_end":775,"line_start":36,"line_end":36,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":788,"byte_end":789,"line_start":36,"line_end":36,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":" ","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `while` condition
4646
--> $DIR/unused_parens_remove_json_suggestion.rs:36:11
4747
|
4848
LL | while (false && true){
@@ -55,7 +55,7 @@ LL + while false && true {
5555
|
5656

5757
"}
58-
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":821,"byte_end":822,"line_start":37,"line_end":37,"column_start":12,"column_end":13,"is_primary":true,"text":[{"text":" if (c) {
58+
{"message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":802,"byte_end":803,"line_start":37,"line_end":37,"column_start":12,"column_end":13,"is_primary":true,"text":[{"text":" if (c) {
5959
--> $DIR/unused_parens_remove_json_suggestion.rs:37:12
6060
|
6161
LL | if (c) {
@@ -68,7 +68,7 @@ LL + if c {
6868
|
6969

7070
"}
71-
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":918,"byte_end":919,"line_start":43,"line_end":43,"column_start":10,"column_end":11,"is_primary":true,"text":[{"text":" while(true && false) {
71+
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":899,"byte_end":900,"line_start":43,"line_end":43,"column_start":10,"column_end":11,"is_primary":true,"text":[{"text":" while(true && false) {
7272
--> $DIR/unused_parens_remove_json_suggestion.rs:43:10
7373
|
7474
LL | while(true && false) {
@@ -81,7 +81,7 @@ LL + while true && false {
8181
|
8282

8383
"}
84-
{"message":"unnecessary parentheses around `for` iterator expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":987,"byte_end":988,"line_start":44,"line_end":44,"column_start":18,"column_end":19,"is_primary":true,"text":[{"text":" for _ in (0 .. 3){
84+
{"message":"unnecessary parentheses around `for` iterator expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":968,"byte_end":969,"line_start":44,"line_end":44,"column_start":18,"column_end":19,"is_primary":true,"text":[{"text":" for _ in (0 .. 3){
8585
--> $DIR/unused_parens_remove_json_suggestion.rs:44:18
8686
|
8787
LL | for _ in (0 .. 3){
@@ -94,7 +94,7 @@ LL + for _ in 0 .. 3 {
9494
|
9595

9696
"}
97-
{"message":"unnecessary parentheses around `for` iterator expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1088,"byte_end":1089,"line_start":49,"line_end":49,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" for _ in (0 .. 3) {
97+
{"message":"unnecessary parentheses around `for` iterator expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1069,"byte_end":1070,"line_start":49,"line_end":49,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" for _ in (0 .. 3) {
9898
--> $DIR/unused_parens_remove_json_suggestion.rs:49:14
9999
|
100100
LL | for _ in (0 .. 3) {
@@ -107,7 +107,7 @@ LL + for _ in 0 .. 3 {
107107
|
108108

109109
"}
110-
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1147,"byte_end":1148,"line_start":50,"line_end":50,"column_start":15,"column_end":16,"is_primary":true,"text":[{"text":" while (true && false) {
110+
{"message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1128,"byte_end":1129,"line_start":50,"line_end":50,"column_start":15,"column_end":16,"is_primary":true,"text":[{"text":" while (true && false) {
111111
--> $DIR/unused_parens_remove_json_suggestion.rs:50:15
112112
|
113113
LL | while (true && false) {

src/test/ui/matches2021.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// edition:2021
3-
// compile-flags: -Zunstable-options
43

54
// regression test for https://github.com/rust-lang/rust/pull/85678
65

src/test/ui/privacy/pub-priv-dep/pub-priv1.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// aux-crate:priv:priv_dep=priv_dep.rs
22
// aux-build:pub_dep.rs
3+
// compile-flags: -Zunstable-options
34
#![deny(exported_private_dependencies)]
45

56
// This crate is a private dependency

src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error: type `OtherType` from private dependency 'priv_dep' in public interface
2-
--> $DIR/pub-priv1.rs:20:5
2+
--> $DIR/pub-priv1.rs:21:5
33
|
44
LL | pub field: OtherType,
55
| ^^^^^^^^^^^^^^^^^^^^
66
|
77
note: the lint level is defined here
8-
--> $DIR/pub-priv1.rs:3:9
8+
--> $DIR/pub-priv1.rs:4:9
99
|
1010
LL | #![deny(exported_private_dependencies)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error: type `OtherType` from private dependency 'priv_dep' in public interface
14-
--> $DIR/pub-priv1.rs:27:5
14+
--> $DIR/pub-priv1.rs:28:5
1515
|
1616
LL | pub fn pub_fn(param: OtherType) {}
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818

1919
error: trait `OtherTrait` from private dependency 'priv_dep' in public interface
20-
--> $DIR/pub-priv1.rs:34:5
20+
--> $DIR/pub-priv1.rs:35:5
2121
|
2222
LL | type Foo: OtherTrait;
2323
| ^^^^^^^^^^^^^^^^^^^^^

src/test/ui/rust-2021/prelude2021.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// check-pass
22
// edition:2021
3-
// compile-flags: -Zunstable-options
43

54
fn main() {
65
let _: u16 = 123i32.try_into().unwrap();

src/test/ui/rust-2021/reserved-prefixes-migration.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// check-pass
22
// run-rustfix
3-
// compile-flags: -Z unstable-options --edition 2018
3+
// edition:2018
44

55
#![warn(rust_2021_prefixes_incompatible_syntax)]
66

src/test/ui/rust-2021/reserved-prefixes-migration.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// check-pass
22
// run-rustfix
3-
// compile-flags: -Z unstable-options --edition 2018
3+
// edition:2018
44

55
#![warn(rust_2021_prefixes_incompatible_syntax)]
66

src/test/ui/unused-crate-deps/extern-loc-missing-loc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// --extern-location with a raw reference
22

33
// aux-crate:bar=bar.rs
4-
// compile-flags:--extern-location bar
4+
// compile-flags:--extern-location bar -Zunstable-options
55

66
#![warn(unused_crate_dependencies)]
77

src/tools/compiletest/src/header.rs

-3
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@ impl TestProps {
242242
if let Some(edition) = config.parse_edition(ln) {
243243
self.compile_flags.push(format!("--edition={}", edition));
244244
has_edition = true;
245-
if edition == "2021" {
246-
self.compile_flags.push("-Zunstable-options".to_string());
247-
}
248245
}
249246

250247
config.parse_and_update_revisions(ln, &mut self.revisions);

src/tools/compiletest/src/runtest.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1607,9 +1607,6 @@ impl<'test> TestCx<'test> {
16071607
get_lib_name(&aux_path.trim_end_matches(".rs").replace('-', "_"), is_dylib);
16081608
rustc.arg("--extern").arg(format!("{}={}/{}", aux_name, aux_dir.display(), lib_name));
16091609
}
1610-
if !self.props.aux_crates.is_empty() {
1611-
rustc.arg("-Zunstable-options");
1612-
}
16131610

16141611
aux_dir
16151612
}

0 commit comments

Comments
 (0)