@@ -431,6 +431,9 @@ pub fn type_known_to_meet_bound<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx
431431 // this function's result remains infallible, we must confirm
432432 // that guess. While imperfect, I believe this is sound.
433433
434+ // The handling of regions in this area of the code is terrible,
435+ // see issue #29149. We should be able to improve on this with
436+ // NLL.
434437 let mut fulfill_cx = FulfillmentContext :: new_ignoring_regions ( ) ;
435438
436439 // We can use a dummy node-id here because we won't pay any mind
@@ -511,8 +514,24 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
511514 unnormalized_env. reveal ) ;
512515
513516 tcx. infer_ctxt ( ) . enter ( |infcx| {
514- let predicates = match fully_normalize (
517+ // FIXME. We should really... do something with these region
518+ // obligations. But this call just continues the older
519+ // behavior (i.e., doesn't cause any new bugs), and it would
520+ // take some further refactoring to actually solve them. In
521+ // particular, we would have to handle implied bounds
522+ // properly, and that code is currently largely confined to
523+ // regionck (though I made some efforts to extract it
524+ // out). -nmatsakis
525+ //
526+ // @arielby: In any case, these obligations are checked
527+ // by wfcheck anyway, so I'm not sure we have to check
528+ // them here too, and we will remove this function when
529+ // we move over to lazy normalization *anyway*.
530+ let fulfill_cx = FulfillmentContext :: new_ignoring_regions ( ) ;
531+
532+ let predicates = match fully_normalize_with_fulfillcx (
515533 & infcx,
534+ fulfill_cx,
516535 cause,
517536 elaborated_env,
518537 // You would really want to pass infcx.param_env.caller_bounds here,
@@ -537,16 +556,6 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
537556 let region_scope_tree = region:: ScopeTree :: default ( ) ;
538557 let free_regions = FreeRegionMap :: new ( ) ;
539558
540- // FIXME. We should really... do something with these region
541- // obligations. But this call just continues the older
542- // behavior (i.e., doesn't cause any new bugs), and it would
543- // take some further refactoring to actually solve them. In
544- // particular, we would have to handle implied bounds
545- // properly, and that code is currently largely confined to
546- // regionck (though I made some efforts to extract it
547- // out). -nmatsakis
548- let _ = infcx. ignore_region_obligations ( ) ;
549-
550559 infcx. resolve_regions_and_report_errors ( region_context, & region_scope_tree, & free_regions) ;
551560 let predicates = match infcx. fully_resolve ( & predicates) {
552561 Ok ( predicates) => predicates,
0 commit comments