Skip to content

Commit 15e0d8b

Browse files
committed
Remove support for -Zast-json and -Zast-json-noexpand
1 parent a259163 commit 15e0d8b

File tree

11 files changed

+2
-112
lines changed

11 files changed

+2
-112
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ use std::convert::TryFrom;
4141
use std::fmt;
4242
use std::mem;
4343

44-
#[cfg(test)]
45-
mod tests;
46-
4744
/// A "Label" is an identifier of some point in sources,
4845
/// e.g. in the following code:
4946
///

compiler/rustc_ast/src/ast/tests.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

compiler/rustc_driver/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,7 @@ fn run_compiler(
343343
return early_exit();
344344
}
345345

346-
if sess.opts.debugging_opts.parse_only
347-
|| sess.opts.debugging_opts.show_span.is_some()
348-
|| sess.opts.debugging_opts.ast_json_noexpand
349-
{
346+
if sess.opts.debugging_opts.parse_only || sess.opts.debugging_opts.show_span.is_some() {
350347
return early_exit();
351348
}
352349

@@ -375,7 +372,7 @@ fn run_compiler(
375372

376373
queries.global_ctxt()?;
377374

378-
if sess.opts.debugging_opts.no_analysis || sess.opts.debugging_opts.ast_json {
375+
if sess.opts.debugging_opts.no_analysis {
379376
return early_exit();
380377
}
381378

compiler/rustc_interface/src/passes.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use rustc_passes::{self, hir_stats, layout_test};
2727
use rustc_plugin_impl as plugin;
2828
use rustc_query_impl::{OnDiskCache, Queries as TcxQueries};
2929
use rustc_resolve::{Resolver, ResolverArenas};
30-
use rustc_serialize::json;
3130
use rustc_session::config::{CrateType, Input, OutputFilenames, OutputType};
3231
use rustc_session::cstore::{MetadataLoader, MetadataLoaderDyn};
3332
use rustc_session::output::{filename_for_input, filename_for_metadata};
@@ -59,10 +58,6 @@ pub fn parse<'a>(sess: &'a Session, input: &Input) -> PResult<'a, ast::Crate> {
5958
}
6059
})?;
6160

62-
if sess.opts.debugging_opts.ast_json_noexpand {
63-
println!("{}", json::as_json(&krate));
64-
}
65-
6661
if sess.opts.debugging_opts.input_stats {
6762
eprintln!("Lines of code: {}", sess.source_map().count_lines());
6863
eprintln!("Pre-expansion node count: {}", count_nodes(&krate));
@@ -423,10 +418,6 @@ pub fn configure_and_expand(
423418
hir_stats::print_ast_stats(&krate, "POST EXPANSION AST STATS");
424419
}
425420

426-
if sess.opts.debugging_opts.ast_json {
427-
println!("{}", json::as_json(&krate));
428-
}
429-
430421
resolver.resolve_crate(&krate);
431422

432423
// Needs to go *after* expansion to be able to check the results of macro expansion.

compiler/rustc_interface/src/tests.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,6 @@ fn test_debugging_options_tracking_hash() {
644644
// Make sure that changing an [UNTRACKED] option leaves the hash unchanged.
645645
// This list is in alphabetical order.
646646
untracked!(assert_incr_state, Some(String::from("loaded")));
647-
untracked!(ast_json, true);
648-
untracked!(ast_json_noexpand, true);
649647
untracked!(borrowck, String::from("other"));
650648
untracked!(deduplicate_diagnostics, false);
651649
untracked!(dep_tasks, true);

compiler/rustc_session/src/options.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,10 +1207,6 @@ options! {
12071207
assert_incr_state: Option<String> = (None, parse_opt_string, [UNTRACKED],
12081208
"assert that the incremental cache is in given state: \
12091209
either `loaded` or `not-loaded`."),
1210-
ast_json: bool = (false, parse_bool, [UNTRACKED],
1211-
"print the AST as JSON and halt (default: no)"),
1212-
ast_json_noexpand: bool = (false, parse_bool, [UNTRACKED],
1213-
"print the pre-expansion AST as JSON and halt (default: no)"),
12141210
binary_dep_depinfo: bool = (false, parse_bool, [TRACKED],
12151211
"include artifacts (sysroot, crate dependencies) used during compilation in dep-info \
12161212
(default: no)"),

src/test/ui/ast-json/ast-json-ice.rs

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/test/ui/ast-json/ast-json-noexpand-output.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/test/ui/ast-json/ast-json-noexpand-output.stdout

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/test/ui/ast-json/ast-json-output.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/test/ui/ast-json/ast-json-output.stdout

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)