diff options
| author | bors <bors@rust-lang.org> | 2022-06-03 17:55:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-03 17:55:02 +0000 |
| commit | 7e9b92cb43a489b34e2bcb8d21f36198e02eedbc (patch) | |
| tree | e2731c205d38c4d2c11fdb1789add435a21bab23 /compiler/rustc_interface/src | |
| parent | 9a74608543d499bcc7dd505e195e8bfab9447315 (diff) | |
| parent | 5cc3593c17360edd92977301ca66551a45119619 (diff) | |
| download | rust-7e9b92cb43a489b34e2bcb8d21f36198e02eedbc.tar.gz rust-7e9b92cb43a489b34e2bcb8d21f36198e02eedbc.zip | |
Auto merge of #85993 - bjorn3:serde_json, r=wesleywiser
Remove all json handling from rustc_serialize Json is now handled using serde_json. Where appropriate I have replaced json usage with binary serialization (rmeta files) or manual string formatting (emcc linker arg generation). This allowed for removing and simplifying a lot of code, which hopefully results in faster serialization/deserialization and faster compiles of rustc itself. Where sensible we now use serde. Metadata and incr cache serialization keeps using a heavily modified (compared to crates.io) rustc-serialize version that in the future could probably be extended with zero-copy deserialization or other perf tricks that serde can't support due to supporting more than one serialization format. Note that I had to remove `-Zast-json` and `-Zast-json-noexpand` as the relevant AST types don't implement `serde::Serialize`. Fixes #40177 See also https://github.com/rust-lang/compiler-team/issues/418
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/tests.rs | 2 |
2 files changed, 0 insertions, 11 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index e6c9c6693c5..3c867e308c4 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -27,7 +27,6 @@ use rustc_passes::{self, hir_stats, layout_test}; use rustc_plugin_impl as plugin; use rustc_query_impl::{OnDiskCache, Queries as TcxQueries}; use rustc_resolve::{Resolver, ResolverArenas}; -use rustc_serialize::json; use rustc_session::config::{CrateType, Input, OutputFilenames, OutputType}; use rustc_session::cstore::{MetadataLoader, MetadataLoaderDyn}; 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> { } })?; - if sess.opts.debugging_opts.ast_json_noexpand { - println!("{}", json::as_json(&krate)); - } - if sess.opts.debugging_opts.input_stats { eprintln!("Lines of code: {}", sess.source_map().count_lines()); eprintln!("Pre-expansion node count: {}", count_nodes(&krate)); @@ -423,10 +418,6 @@ pub fn configure_and_expand( hir_stats::print_ast_stats(&krate, "POST EXPANSION AST STATS"); } - if sess.opts.debugging_opts.ast_json { - println!("{}", json::as_json(&krate)); - } - resolver.resolve_crate(&krate); // Needs to go *after* expansion to be able to check the results of macro expansion. diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index 1327bf6fcd4..a178cca6d10 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -644,8 +644,6 @@ fn test_debugging_options_tracking_hash() { // Make sure that changing an [UNTRACKED] option leaves the hash unchanged. // This list is in alphabetical order. untracked!(assert_incr_state, Some(String::from("loaded"))); - untracked!(ast_json, true); - untracked!(ast_json_noexpand, true); untracked!(borrowck, String::from("other")); untracked!(deduplicate_diagnostics, false); untracked!(dep_tasks, true); |
