Skip to content

Commit 50840ee

Browse files
committed
Delay bug; this sidesteps ICE'ing when compiler is just doing error-recovery.
1 parent 8895384 commit 50840ee

File tree

1 file changed

+10
-9
lines changed
  • src/librustc/infer/lexical_region_resolve

1 file changed

+10
-9
lines changed

src/librustc/infer/lexical_region_resolve/mod.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -764,16 +764,17 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
764764
}
765765
}
766766

767-
span_bug!(
767+
// Errors in earlier passes can yield error variables without
768+
// resolution errors here; delay ICE in favor of those errors.
769+
self.tcx().sess.delay_span_bug(
768770
self.var_infos[node_idx].origin.span(),
769-
"collect_error_for_expanding_node() could not find \
770-
error for var {:?} in universe {:?}, lower_bounds={:#?}, \
771-
upper_bounds={:#?}",
772-
node_idx,
773-
node_universe,
774-
lower_bounds,
775-
upper_bounds
776-
);
771+
&format!("collect_error_for_expanding_node() could not find \
772+
error for var {:?} in universe {:?}, lower_bounds={:#?}, \
773+
upper_bounds={:#?}",
774+
node_idx,
775+
node_universe,
776+
lower_bounds,
777+
upper_bounds));
777778
}
778779

779780
fn collect_concrete_regions(

0 commit comments

Comments
 (0)