diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index 110c49d820a..ba99ff5291a 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -1131,9 +1131,9 @@ pub fn resolve_regions_and_report_errors(&self, region_context: DefId, region_map: ®ion::ScopeTree, free_regions: &FreeRegionMap<'tcx>) { - // TODO assert!(self.region_obligations.borrow().is_empty(), - // TODO "region_obligations not empty: {:#?}", - // TODO self.region_obligations.borrow()); + assert!(self.is_tainted_by_errors() || self.region_obligations.borrow().is_empty(), + "region_obligations not empty: {:#?}", + self.region_obligations.borrow()); let region_rels = RegionRelations::new(self.tcx, region_context, diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs index 297974f1c9a..cd4a6878851 100644 --- a/src/librustc/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -511,6 +511,7 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, unnormalized_env.reveal); tcx.infer_ctxt().enter(|infcx| { + let body_id = cause.body_id; let predicates = match fully_normalize( &infcx, cause, @@ -536,6 +537,14 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let region_scope_tree = region::ScopeTree::default(); let free_regions = FreeRegionMap::new(); + + // TODO We should really... do something with these. But as of + // this writing we were ignoring them, just without knowing + // it, and it would take some refactoring to stop doing so. + // (In particular, the needed methods currently live in + // regionck.) -nmatsakis + let _ = infcx.take_region_obligations(body_id); + infcx.resolve_regions_and_report_errors(region_context, ®ion_scope_tree, &free_regions); let predicates = match infcx.fully_resolve(&predicates) { Ok(predicates) => predicates,