Skip to content

Clean up some -Z unstable-options in tests. #90554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/test/ui/hello2021.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// run-pass
// edition:2021
// compile-flags: -Zunstable-options

fn main() {
println!("hello, 2021");
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/iterators/into-iter-on-arrays-2021.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// check-pass
// edition:2021
// compile-flags: -Zunstable-options

use std::array::IntoIter;
use std::ops::Deref;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
// despite $LINT being allowed on command line
// compile-flags: -A const_err --force-warn const_err -Zunstable-options
// compile-flags: -A const_err --force-warn const_err
// check-pass

const C: i32 = 1 / 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --force-warn $LINT_GROUP causes $LINT (which is warn-by-default) to warn
// despite $LINT being allowed on command line
// compile-flags: -A bare-trait-objects --force-warn rust-2018-idioms -Zunstable-options
// compile-flags: -A bare-trait-objects --force-warn rust-2018-idioms
// check-pass

pub trait SomeTrait {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --force-warn $LINT causes $LINT (which is warn-by-default) to warn
// despite being allowed in one submodule (but not the other)
// compile-flags: --force-warn dead_code -Zunstable-options
// compile-flags: --force-warn dead_code
// check-pass

mod one {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/force-warn/warnings-lint-group.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// --force-warn warnings is an error
// compile-flags: --force-warn warnings -Zunstable-options
// compile-flags: --force-warn warnings
// error-pattern: `warnings` lint group is not supported

fn main() {}
4 changes: 1 addition & 3 deletions src/test/ui/lint/force-warn/warnings-lint-group.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ error[E0602]: `warnings` lint group is not supported with ´--force-warn´

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

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

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0602`.
2 changes: 1 addition & 1 deletion src/test/ui/lint/unused_parens_json_suggestion.fixed
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --error-format json -Zunstable-options
// compile-flags: --error-format json
// run-rustfix

// The output for humans should just highlight the whole span without showing
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/unused_parens_json_suggestion.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --error-format json -Zunstable-options
// compile-flags: --error-format json
// run-rustfix

// The output for humans should just highlight the whole span without showing
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/unused_parens_json_suggestion.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"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));
{"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));
--> $DIR/unused_parens_json_suggestion.rs:16:14
|
LL | let _a = (1 / (2 + 3));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --error-format json -Zunstable-options
// compile-flags: --error-format json
// run-rustfix

// The output for humans should just highlight the whole span without showing
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/unused_parens_remove_json_suggestion.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --error-format json -Zunstable-options
// compile-flags: --error-format json
// run-rustfix

// The output for humans should just highlight the whole span without showing
Expand Down
18 changes: 9 additions & 9 deletions src/test/ui/lint/unused_parens_remove_json_suggestion.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"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) {
{"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) {
--> $DIR/unused_parens_remove_json_suggestion.rs:17:8
|
LL | if (_b) {
Expand All @@ -16,7 +16,7 @@ LL + if _b {
|

"}
{"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) {
{"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) {
--> $DIR/unused_parens_remove_json_suggestion.rs:28:7
|
LL | if(c) {
Expand All @@ -29,7 +29,7 @@ LL + if c {
|

"}
{"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){
{"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){
--> $DIR/unused_parens_remove_json_suggestion.rs:32:8
|
LL | if (c){
Expand All @@ -42,7 +42,7 @@ LL + if c {
|

"}
{"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
{"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
--> $DIR/unused_parens_remove_json_suggestion.rs:36:11
|
LL | while (false && true){
Expand All @@ -55,7 +55,7 @@ LL + while false && true {
|

"}
{"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) {
{"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) {
--> $DIR/unused_parens_remove_json_suggestion.rs:37:12
|
LL | if (c) {
Expand All @@ -68,7 +68,7 @@ LL + if c {
|

"}
{"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) {
{"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) {
--> $DIR/unused_parens_remove_json_suggestion.rs:43:10
|
LL | while(true && false) {
Expand All @@ -81,7 +81,7 @@ LL + while true && false {
|

"}
{"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){
{"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){
--> $DIR/unused_parens_remove_json_suggestion.rs:44:18
|
LL | for _ in (0 .. 3){
Expand All @@ -94,7 +94,7 @@ LL + for _ in 0 .. 3 {
|

"}
{"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) {
{"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) {
--> $DIR/unused_parens_remove_json_suggestion.rs:49:14
|
LL | for _ in (0 .. 3) {
Expand All @@ -107,7 +107,7 @@ LL + for _ in 0 .. 3 {
|

"}
{"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) {
{"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) {
--> $DIR/unused_parens_remove_json_suggestion.rs:50:15
|
LL | while (true && false) {
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/matches2021.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// run-pass
// edition:2021
// compile-flags: -Zunstable-options

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

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/privacy/pub-priv-dep/pub-priv1.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// aux-crate:priv:priv_dep=priv_dep.rs
// aux-build:pub_dep.rs
// compile-flags: -Zunstable-options
#![deny(exported_private_dependencies)]

// This crate is a private dependency
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
error: type `OtherType` from private dependency 'priv_dep' in public interface
--> $DIR/pub-priv1.rs:20:5
--> $DIR/pub-priv1.rs:21:5
|
LL | pub field: OtherType,
| ^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/pub-priv1.rs:3:9
--> $DIR/pub-priv1.rs:4:9
|
LL | #![deny(exported_private_dependencies)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

error: trait `OtherTrait` from private dependency 'priv_dep' in public interface
--> $DIR/pub-priv1.rs:34:5
--> $DIR/pub-priv1.rs:35:5
|
LL | type Foo: OtherTrait;
| ^^^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/rust-2021/prelude2021.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// check-pass
// edition:2021
// compile-flags: -Zunstable-options

fn main() {
let _: u16 = 123i32.try_into().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rust-2021/reserved-prefixes-migration.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// check-pass
// run-rustfix
// compile-flags: -Z unstable-options --edition 2018
// edition:2018

#![warn(rust_2021_prefixes_incompatible_syntax)]

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rust-2021/reserved-prefixes-migration.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// check-pass
// run-rustfix
// compile-flags: -Z unstable-options --edition 2018
// edition:2018

#![warn(rust_2021_prefixes_incompatible_syntax)]

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/unused-crate-deps/extern-loc-missing-loc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// --extern-location with a raw reference

// aux-crate:bar=bar.rs
// compile-flags:--extern-location bar
// compile-flags:--extern-location bar -Zunstable-options

#![warn(unused_crate_dependencies)]

Expand Down
3 changes: 0 additions & 3 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ impl TestProps {
if let Some(edition) = config.parse_edition(ln) {
self.compile_flags.push(format!("--edition={}", edition));
has_edition = true;
if edition == "2021" {
self.compile_flags.push("-Zunstable-options".to_string());
}
}

config.parse_and_update_revisions(ln, &mut self.revisions);
Expand Down
3 changes: 0 additions & 3 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1607,9 +1607,6 @@ impl<'test> TestCx<'test> {
get_lib_name(&aux_path.trim_end_matches(".rs").replace('-', "_"), is_dylib);
rustc.arg("--extern").arg(format!("{}={}/{}", aux_name, aux_dir.display(), lib_name));
}
if !self.props.aux_crates.is_empty() {
rustc.arg("-Zunstable-options");
}

aux_dir
}
Expand Down