about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-12-17 10:05:39 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2020-12-17 10:05:39 +0100
commit3a3a23ffc5742885187c84e7db320610c8b352fb (patch)
tree1a2764313ccce04065fb81976971b1460fcf8669 /compiler/rustc_interface/src
parent2c0dccb7f2affb0013b00ebeb35ad12fcffa99a6 (diff)
downloadrust-3a3a23ffc5742885187c84e7db320610c8b352fb.tar.gz
rust-3a3a23ffc5742885187c84e7db320610c8b352fb.zip
Fix tests
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 3f30b7e69e4..8b9bf17f3f4 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -996,9 +996,12 @@ pub fn start_codegen<'tcx>(
         codegen_backend.codegen_crate(tcx, metadata, need_metadata_module)
     });
 
-    rustc_incremental::assert_module_sources::assert_module_sources(tcx);
-
-    rustc_symbol_mangling::test::report_symbol_names(tcx);
+    // 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));