From 50840ee851c7059e6261b2d961d5386e6763e963 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Tue, 9 Jul 2019 13:49:20 +0200 Subject: [PATCH] Delay bug; this sidesteps ICE'ing when compiler is just doing error-recovery. --- .../infer/lexical_region_resolve/mod.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/librustc/infer/lexical_region_resolve/mod.rs b/src/librustc/infer/lexical_region_resolve/mod.rs index d06c4434b3aa..4bfe953e45c0 100644 --- a/src/librustc/infer/lexical_region_resolve/mod.rs +++ b/src/librustc/infer/lexical_region_resolve/mod.rs @@ -764,16 +764,17 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> { } } - span_bug!( + // Errors in earlier passes can yield error variables without + // resolution errors here; delay ICE in favor of those errors. + self.tcx().sess.delay_span_bug( self.var_infos[node_idx].origin.span(), - "collect_error_for_expanding_node() could not find \ - error for var {:?} in universe {:?}, lower_bounds={:#?}, \ - upper_bounds={:#?}", - node_idx, - node_universe, - lower_bounds, - upper_bounds - ); + &format!("collect_error_for_expanding_node() could not find \ + error for var {:?} in universe {:?}, lower_bounds={:#?}, \ + upper_bounds={:#?}", + node_idx, + node_universe, + lower_bounds, + upper_bounds)); } fn collect_concrete_regions(