@@ -431,6 +431,9 @@ pub fn type_known_to_meet_bound<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx
431
431
// this function's result remains infallible, we must confirm
432
432
// that guess. While imperfect, I believe this is sound.
433
433
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.
434
437
let mut fulfill_cx = FulfillmentContext :: new_ignoring_regions ( ) ;
435
438
436
439
// 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>,
511
514
unnormalized_env. reveal ) ;
512
515
513
516
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 (
515
533
& infcx,
534
+ fulfill_cx,
516
535
cause,
517
536
elaborated_env,
518
537
// 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>,
537
556
let region_scope_tree = region:: ScopeTree :: default ( ) ;
538
557
let free_regions = FreeRegionMap :: new ( ) ;
539
558
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
-
550
559
infcx. resolve_regions_and_report_errors ( region_context, & region_scope_tree, & free_regions) ;
551
560
let predicates = match infcx. fully_resolve ( & predicates) {
552
561
Ok ( predicates) => predicates,
0 commit comments