Skip to content

Commit 3a3a23f

Browse files
committed
Fix tests
1 parent 2c0dccb commit 3a3a23f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler/rustc_interface/src/passes.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -996,9 +996,12 @@ pub fn start_codegen<'tcx>(
996996
codegen_backend.codegen_crate(tcx, metadata, need_metadata_module)
997997
});
998998

999-
rustc_incremental::assert_module_sources::assert_module_sources(tcx);
1000-
1001-
rustc_symbol_mangling::test::report_symbol_names(tcx);
999+
// Don't run these test assertions when not doing codegen. Compiletest tries to build
1000+
// build-fail tests in check mode first and expects it to not give an error in that case.
1001+
if tcx.sess.opts.output_types.should_codegen() {
1002+
rustc_incremental::assert_module_sources::assert_module_sources(tcx);
1003+
rustc_symbol_mangling::test::report_symbol_names(tcx);
1004+
}
10021005

10031006
tcx.sess.time("assert_dep_graph", || rustc_incremental::assert_dep_graph(tcx));
10041007
tcx.sess.time("serialize_dep_graph", || rustc_incremental::save_dep_graph(tcx));

0 commit comments

Comments
 (0)