Skip to content

Commit 380e388

Browse files
committed
do not run MIR type checker twice
1 parent 063deba commit 380e388

File tree

1 file changed

+4
-0
lines changed
  • src/librustc_mir/borrow_check/nll/type_check

1 file changed

+4
-0
lines changed

src/librustc_mir/borrow_check/nll/type_check/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,10 @@ impl MirPass for TypeckMir {
15851585
let id = tcx.hir.as_local_node_id(def_id).unwrap();
15861586
debug!("run_pass: {:?}", def_id);
15871587

1588+
if tcx.sess.nll() {
1589+
return;
1590+
}
1591+
15881592
if tcx.sess.err_count() > 0 {
15891593
// compiling a broken program can obviously result in a
15901594
// broken MIR, so try not to report duplicate errors.

0 commit comments

Comments
 (0)