From d1d9cfc7221d0b0b791f571049b13cf86d1d8ed1 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Fri, 3 Nov 2017 16:22:19 +0100 Subject: [PATCH] Don't add a new -Z flag, reuse -Zunstable-options --- src/librustc/session/config.rs | 104 +++++++++--------- .../ui/lint/unused_parens_json_suggestion.rs | 2 +- src/test/ui/lint/use_suggestion_json.rs | 2 +- 3 files changed, 53 insertions(+), 55 deletions(-) diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 3e93a633246..7a5b3afe5ae 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -1104,8 +1104,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "enable ThinLTO when possible"), inline_in_all_cgus: Option = (None, parse_opt_bool, [TRACKED], "control whether #[inline] functions are in all cgus"), - pretty_json_error_format: bool = (false, parse_bool, [UNTRACKED], - "allow `--error-format=pretty-json` (used for compiletest)"), } pub fn default_lib_output() -> CrateType { @@ -1477,7 +1475,7 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches) let debugging_opts = build_debugging_options(matches, error_format); - if !debugging_opts.pretty_json_error_format && error_format == ErrorOutputType::Json(true) { + if !debugging_opts.unstable_options && error_format == ErrorOutputType::Json(true) { early_error(ErrorOutputType::Json(false), "--error-format=pretty-json is unstable \ (use -Zpretty-json-error-format)"); } @@ -2262,46 +2260,46 @@ mod tests { let mut v5 = super::basic_options(); // Reference - v1.search_paths.add_path("native=abc", super::ErrorOutputType::Json); - v1.search_paths.add_path("crate=def", super::ErrorOutputType::Json); - v1.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json); - v1.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json); - v1.search_paths.add_path("all=mno", super::ErrorOutputType::Json); + v1.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false)); + v1.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false)); + v1.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false)); + v1.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false)); + v1.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false)); // Native changed - v2.search_paths.add_path("native=XXX", super::ErrorOutputType::Json); - v2.search_paths.add_path("crate=def", super::ErrorOutputType::Json); - v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json); - v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json); - v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json); + v2.search_paths.add_path("native=XXX", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false)); // Crate changed - v2.search_paths.add_path("native=abc", super::ErrorOutputType::Json); - v2.search_paths.add_path("crate=XXX", super::ErrorOutputType::Json); - v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json); - v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json); - v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json); + v2.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("crate=XXX", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false)); // Dependency changed - v3.search_paths.add_path("native=abc", super::ErrorOutputType::Json); - v3.search_paths.add_path("crate=def", super::ErrorOutputType::Json); - v3.search_paths.add_path("dependency=XXX", super::ErrorOutputType::Json); - v3.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json); - v3.search_paths.add_path("all=mno", super::ErrorOutputType::Json); + v3.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false)); + v3.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false)); + v3.search_paths.add_path("dependency=XXX", super::ErrorOutputType::Json(false)); + v3.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false)); + v3.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false)); // Framework changed - v4.search_paths.add_path("native=abc", super::ErrorOutputType::Json); - v4.search_paths.add_path("crate=def", super::ErrorOutputType::Json); - v4.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json); - v4.search_paths.add_path("framework=XXX", super::ErrorOutputType::Json); - v4.search_paths.add_path("all=mno", super::ErrorOutputType::Json); + v4.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false)); + v4.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false)); + v4.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false)); + v4.search_paths.add_path("framework=XXX", super::ErrorOutputType::Json(false)); + v4.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false)); // All changed - v5.search_paths.add_path("native=abc", super::ErrorOutputType::Json); - v5.search_paths.add_path("crate=def", super::ErrorOutputType::Json); - v5.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json); - v5.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json); - v5.search_paths.add_path("all=XXX", super::ErrorOutputType::Json); + v5.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false)); + v5.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false)); + v5.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false)); + v5.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false)); + v5.search_paths.add_path("all=XXX", super::ErrorOutputType::Json(false)); assert!(v1.dep_tracking_hash() != v2.dep_tracking_hash()); assert!(v1.dep_tracking_hash() != v3.dep_tracking_hash()); @@ -2324,29 +2322,29 @@ mod tests { let mut v4 = super::basic_options(); // Reference - v1.search_paths.add_path("native=abc", super::ErrorOutputType::Json); - v1.search_paths.add_path("crate=def", super::ErrorOutputType::Json); - v1.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json); - v1.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json); - v1.search_paths.add_path("all=mno", super::ErrorOutputType::Json); + v1.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false)); + v1.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false)); + v1.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false)); + v1.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false)); + v1.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false)); - v2.search_paths.add_path("native=abc", super::ErrorOutputType::Json); - v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json); - v2.search_paths.add_path("crate=def", super::ErrorOutputType::Json); - v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json); - v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json); + v2.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false)); + v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false)); - v3.search_paths.add_path("crate=def", super::ErrorOutputType::Json); - v3.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json); - v3.search_paths.add_path("native=abc", super::ErrorOutputType::Json); - v3.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json); - v3.search_paths.add_path("all=mno", super::ErrorOutputType::Json); + v3.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false)); + v3.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false)); + v3.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false)); + v3.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false)); + v3.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false)); - v4.search_paths.add_path("all=mno", super::ErrorOutputType::Json); - v4.search_paths.add_path("native=abc", super::ErrorOutputType::Json); - v4.search_paths.add_path("crate=def", super::ErrorOutputType::Json); - v4.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json); - v4.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json); + v4.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false)); + v4.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false)); + v4.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false)); + v4.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false)); + v4.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false)); assert!(v1.dep_tracking_hash() == v2.dep_tracking_hash()); assert!(v1.dep_tracking_hash() == v3.dep_tracking_hash()); diff --git a/src/test/ui/lint/unused_parens_json_suggestion.rs b/src/test/ui/lint/unused_parens_json_suggestion.rs index e05eac774bf..ad501e66809 100644 --- a/src/test/ui/lint/unused_parens_json_suggestion.rs +++ b/src/test/ui/lint/unused_parens_json_suggestion.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: --error-format pretty-json -Zpretty_json_error_format +// compile-flags: --error-format pretty-json -Zunstable-options // The output for humans should just highlight the whole span without showing // the suggested replacement, but we also want to test that suggested diff --git a/src/test/ui/lint/use_suggestion_json.rs b/src/test/ui/lint/use_suggestion_json.rs index 19169722b35..27232c4fec4 100644 --- a/src/test/ui/lint/use_suggestion_json.rs +++ b/src/test/ui/lint/use_suggestion_json.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: --error-format pretty-json -Zpretty_json_error_format +// compile-flags: --error-format pretty-json -Zunstable-options // The output for humans should just highlight the whole span without showing // the suggested replacement, but we also want to test that suggested