about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-28 15:57:50 +0000
committerbors <bors@rust-lang.org>2020-12-28 15:57:50 +0000
commit2987785df3d46d5ff144a5c67fbb8f5cca798d78 (patch)
treebc371b2306dc81420d2549802d22d78510948fd4 /compiler/rustc_interface/src
parent76aca6659a0eb3f5696541d0be518530cabdd963 (diff)
parenta4a59a0f17dae56b5401ff9a2385742c4add2956 (diff)
downloadrust-2987785df3d46d5ff144a5c67fbb8f5cca798d78.tar.gz
rust-2987785df3d46d5ff144a5c67fbb8f5cca798d78.zip
Auto merge of #80439 - Dylan-DPC:rollup-rdxcvon, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #79662 (Move some more code out of CodegenBackend::{codegen_crate,link})
 - #79815 (Update RELEASES.md for 1.49.0)
 - #80284 (Suggest fn ptr rather than fn item and suggest to use `Fn` trait bounds rather than the unique closure type in E0121)
 - #80331 (Add more comments to trait queries)
 - #80344 (use matches!() macro in more places)
 - #80353 (BTreeMap: test split_off (and append) more thoroughly)
 - #80362 (Document rustc_macros on nightly-rustc)
 - #80399 (Remove FIXME in rustc_privacy)
 - #80408 (Sync rustc_codegen_cranelift)
 - #80411 (rustc_span: Remove `Symbol::with`)
 - #80434 (bootstrap: put the component name in the tarball temp dir path)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs17
-rw-r--r--compiler/rustc_interface/src/queries.rs1
2 files changed, 18 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 61ebd6d2198..1a2af48b38d 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -1013,6 +1013,23 @@ pub fn start_codegen<'tcx>(
         codegen_backend.codegen_crate(tcx, metadata, need_metadata_module)
     });
 
+    // Don't run these test assertions when not doing codegen. Compiletest tries to build
+    // build-fail tests in check mode first and expects it to not give an error in that case.
+    if tcx.sess.opts.output_types.should_codegen() {
+        rustc_incremental::assert_module_sources::assert_module_sources(tcx);
+        rustc_symbol_mangling::test::report_symbol_names(tcx);
+    }
+
+    tcx.sess.time("assert_dep_graph", || rustc_incremental::assert_dep_graph(tcx));
+    tcx.sess.time("serialize_dep_graph", || rustc_incremental::save_dep_graph(tcx));
+
+    // We assume that no queries are run past here. If there are new queries
+    // after this point, they'll show up as "<unknown>" in self-profiling data.
+    {
+        let _prof_timer = tcx.prof.generic_activity("self_profile_alloc_query_strings");
+        tcx.alloc_self_profile_query_strings();
+    }
+
     info!("Post-codegen\n{:?}", tcx.debug_stats());
 
     if tcx.sess.opts.output_types.contains_key(&OutputType::Mir) {
diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs
index 6ea0828cea0..2384927b301 100644
--- a/compiler/rustc_interface/src/queries.rs
+++ b/compiler/rustc_interface/src/queries.rs
@@ -403,6 +403,7 @@ impl Linker {
             return Ok(());
         }
 
+        let _timer = sess.prof.verbose_generic_activity("link_crate");
         self.codegen_backend.link(&self.sess, codegen_results, &self.prepare_outputs)
     }
 }