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,
unnormalized_env.reveal);
tcx.infer_ctxt().enter(|infcx| {
+ let body_id = cause.body_id;
let predicates = match fully_normalize(
&infcx,
cause,
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,