Skip to content

Commit d1d9cfc

Browse files
committed
Don't add a new -Z flag, reuse -Zunstable-options
1 parent c7cb2cf commit d1d9cfc

File tree

3 files changed

+56
-58
lines changed

3 files changed

+56
-58
lines changed

src/librustc/session/config.rs

+54-56
Original file line numberDiff line numberDiff line change
@@ -1104,8 +1104,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
11041104
"enable ThinLTO when possible"),
11051105
inline_in_all_cgus: Option<bool> = (None, parse_opt_bool, [TRACKED],
11061106
"control whether #[inline] functions are in all cgus"),
1107-
pretty_json_error_format: bool = (false, parse_bool, [UNTRACKED],
1108-
"allow `--error-format=pretty-json` (used for compiletest)"),
11091107
}
11101108

11111109
pub fn default_lib_output() -> CrateType {
@@ -1477,7 +1475,7 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
14771475

14781476
let debugging_opts = build_debugging_options(matches, error_format);
14791477

1480-
if !debugging_opts.pretty_json_error_format && error_format == ErrorOutputType::Json(true) {
1478+
if !debugging_opts.unstable_options && error_format == ErrorOutputType::Json(true) {
14811479
early_error(ErrorOutputType::Json(false), "--error-format=pretty-json is unstable \
14821480
(use -Zpretty-json-error-format)");
14831481
}
@@ -2262,46 +2260,46 @@ mod tests {
22622260
let mut v5 = super::basic_options();
22632261

22642262
// Reference
2265-
v1.search_paths.add_path("native=abc", super::ErrorOutputType::Json);
2266-
v1.search_paths.add_path("crate=def", super::ErrorOutputType::Json);
2267-
v1.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json);
2268-
v1.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json);
2269-
v1.search_paths.add_path("all=mno", super::ErrorOutputType::Json);
2263+
v1.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
2264+
v1.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
2265+
v1.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
2266+
v1.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
2267+
v1.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));
22702268

22712269
// Native changed
2272-
v2.search_paths.add_path("native=XXX", super::ErrorOutputType::Json);
2273-
v2.search_paths.add_path("crate=def", super::ErrorOutputType::Json);
2274-
v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json);
2275-
v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json);
2276-
v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json);
2270+
v2.search_paths.add_path("native=XXX", super::ErrorOutputType::Json(false));
2271+
v2.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
2272+
v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
2273+
v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
2274+
v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));
22772275

22782276
// Crate changed
2279-
v2.search_paths.add_path("native=abc", super::ErrorOutputType::Json);
2280-
v2.search_paths.add_path("crate=XXX", super::ErrorOutputType::Json);
2281-
v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json);
2282-
v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json);
2283-
v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json);
2277+
v2.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
2278+
v2.search_paths.add_path("crate=XXX", super::ErrorOutputType::Json(false));
2279+
v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
2280+
v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
2281+
v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));
22842282

22852283
// Dependency changed
2286-
v3.search_paths.add_path("native=abc", super::ErrorOutputType::Json);
2287-
v3.search_paths.add_path("crate=def", super::ErrorOutputType::Json);
2288-
v3.search_paths.add_path("dependency=XXX", super::ErrorOutputType::Json);
2289-
v3.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json);
2290-
v3.search_paths.add_path("all=mno", super::ErrorOutputType::Json);
2284+
v3.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
2285+
v3.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
2286+
v3.search_paths.add_path("dependency=XXX", super::ErrorOutputType::Json(false));
2287+
v3.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
2288+
v3.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));
22912289

22922290
// Framework changed
2293-
v4.search_paths.add_path("native=abc", super::ErrorOutputType::Json);
2294-
v4.search_paths.add_path("crate=def", super::ErrorOutputType::Json);
2295-
v4.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json);
2296-
v4.search_paths.add_path("framework=XXX", super::ErrorOutputType::Json);
2297-
v4.search_paths.add_path("all=mno", super::ErrorOutputType::Json);
2291+
v4.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
2292+
v4.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
2293+
v4.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
2294+
v4.search_paths.add_path("framework=XXX", super::ErrorOutputType::Json(false));
2295+
v4.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));
22982296

22992297
// All changed
2300-
v5.search_paths.add_path("native=abc", super::ErrorOutputType::Json);
2301-
v5.search_paths.add_path("crate=def", super::ErrorOutputType::Json);
2302-
v5.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json);
2303-
v5.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json);
2304-
v5.search_paths.add_path("all=XXX", super::ErrorOutputType::Json);
2298+
v5.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
2299+
v5.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
2300+
v5.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
2301+
v5.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
2302+
v5.search_paths.add_path("all=XXX", super::ErrorOutputType::Json(false));
23052303

23062304
assert!(v1.dep_tracking_hash() != v2.dep_tracking_hash());
23072305
assert!(v1.dep_tracking_hash() != v3.dep_tracking_hash());
@@ -2324,29 +2322,29 @@ mod tests {
23242322
let mut v4 = super::basic_options();
23252323

23262324
// Reference
2327-
v1.search_paths.add_path("native=abc", super::ErrorOutputType::Json);
2328-
v1.search_paths.add_path("crate=def", super::ErrorOutputType::Json);
2329-
v1.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json);
2330-
v1.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json);
2331-
v1.search_paths.add_path("all=mno", super::ErrorOutputType::Json);
2332-
2333-
v2.search_paths.add_path("native=abc", super::ErrorOutputType::Json);
2334-
v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json);
2335-
v2.search_paths.add_path("crate=def", super::ErrorOutputType::Json);
2336-
v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json);
2337-
v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json);
2338-
2339-
v3.search_paths.add_path("crate=def", super::ErrorOutputType::Json);
2340-
v3.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json);
2341-
v3.search_paths.add_path("native=abc", super::ErrorOutputType::Json);
2342-
v3.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json);
2343-
v3.search_paths.add_path("all=mno", super::ErrorOutputType::Json);
2344-
2345-
v4.search_paths.add_path("all=mno", super::ErrorOutputType::Json);
2346-
v4.search_paths.add_path("native=abc", super::ErrorOutputType::Json);
2347-
v4.search_paths.add_path("crate=def", super::ErrorOutputType::Json);
2348-
v4.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json);
2349-
v4.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json);
2325+
v1.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
2326+
v1.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
2327+
v1.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
2328+
v1.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
2329+
v1.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));
2330+
2331+
v2.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
2332+
v2.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
2333+
v2.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
2334+
v2.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
2335+
v2.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));
2336+
2337+
v3.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
2338+
v3.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
2339+
v3.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
2340+
v3.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
2341+
v3.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));
2342+
2343+
v4.search_paths.add_path("all=mno", super::ErrorOutputType::Json(false));
2344+
v4.search_paths.add_path("native=abc", super::ErrorOutputType::Json(false));
2345+
v4.search_paths.add_path("crate=def", super::ErrorOutputType::Json(false));
2346+
v4.search_paths.add_path("dependency=ghi", super::ErrorOutputType::Json(false));
2347+
v4.search_paths.add_path("framework=jkl", super::ErrorOutputType::Json(false));
23502348

23512349
assert!(v1.dep_tracking_hash() == v2.dep_tracking_hash());
23522350
assert!(v1.dep_tracking_hash() == v3.dep_tracking_hash());

src/test/ui/lint/unused_parens_json_suggestion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: --error-format pretty-json -Zpretty_json_error_format
11+
// compile-flags: --error-format pretty-json -Zunstable-options
1212

1313
// The output for humans should just highlight the whole span without showing
1414
// the suggested replacement, but we also want to test that suggested

src/test/ui/lint/use_suggestion_json.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: --error-format pretty-json -Zpretty_json_error_format
11+
// compile-flags: --error-format pretty-json -Zunstable-options
1212

1313
// The output for humans should just highlight the whole span without showing
1414
// the suggested replacement, but we also want to test that suggested

0 commit comments

Comments
 (0)