@@ -356,7 +356,7 @@ pub fn type_known_to_meet_builtin_bound<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
356356 // this function's result remains infallible, we must confirm
357357 // that guess. While imperfect, I believe this is sound.
358358
359- let mut fulfill_cx = FulfillmentContext :: new ( false ) ;
359+ let mut fulfill_cx = FulfillmentContext :: new ( ) ;
360360
361361 // We can use a dummy node-id here because we won't pay any mind
362362 // to region obligations that arise (there shouldn't really be any
@@ -434,8 +434,9 @@ pub fn normalize_param_env_or_error<'a,'tcx>(unnormalized_env: ty::ParameterEnvi
434434
435435 let elaborated_env = unnormalized_env. with_caller_bounds ( predicates) ;
436436
437- let infcx = infer:: new_infer_ctxt ( tcx, & tcx. tables , Some ( elaborated_env) , false ) ;
438- let predicates = match fully_normalize ( & infcx, cause,
437+ let infcx = infer:: new_infer_ctxt ( tcx, & tcx. tables , Some ( elaborated_env) ) ;
438+ let predicates = match fully_normalize ( & infcx,
439+ cause,
439440 & infcx. parameter_environment . caller_bounds ) {
440441 Ok ( predicates) => predicates,
441442 Err ( errors) => {
@@ -444,6 +445,9 @@ pub fn normalize_param_env_or_error<'a,'tcx>(unnormalized_env: ty::ParameterEnvi
444445 }
445446 } ;
446447
448+ debug ! ( "normalize_param_env_or_error: normalized predicates={:?}" ,
449+ predicates) ;
450+
447451 let free_regions = FreeRegionMap :: new ( ) ;
448452 infcx. resolve_regions_and_report_errors ( & free_regions, body_id) ;
449453 let predicates = match infcx. fully_resolve ( & predicates) {
@@ -462,6 +466,9 @@ pub fn normalize_param_env_or_error<'a,'tcx>(unnormalized_env: ty::ParameterEnvi
462466 }
463467 } ;
464468
469+ debug ! ( "normalize_param_env_or_error: resolved predicates={:?}" ,
470+ predicates) ;
471+
465472 infcx. parameter_environment . with_caller_bounds ( predicates)
466473}
467474
@@ -471,7 +478,7 @@ pub fn fully_normalize<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
471478 -> Result < T , Vec < FulfillmentError < ' tcx > > >
472479 where T : TypeFoldable < ' tcx >
473480{
474- debug ! ( "normalize_param_env (value={:?})" , value) ;
481+ debug ! ( "fully_normalize (value={:?})" , value) ;
475482
476483 let mut selcx = & mut SelectionContext :: new ( infcx) ;
477484 // FIXME (@jroesch) ISSUE 26721
@@ -487,20 +494,28 @@ pub fn fully_normalize<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
487494 //
488495 // I think we should probably land this refactor and then come
489496 // back to this is a follow-up patch.
490- let mut fulfill_cx = FulfillmentContext :: new ( false ) ;
497+ let mut fulfill_cx = FulfillmentContext :: new ( ) ;
491498
492499 let Normalized { value : normalized_value, obligations } =
493500 project:: normalize ( selcx, cause, value) ;
494- debug ! ( "normalize_param_env : normalized_value={:?} obligations={:?}" ,
501+ debug ! ( "fully_normalize : normalized_value={:?} obligations={:?}" ,
495502 normalized_value,
496503 obligations) ;
497504 for obligation in obligations {
498505 fulfill_cx. register_predicate_obligation ( selcx. infcx ( ) , obligation) ;
499506 }
500507
501- try!( fulfill_cx. select_all_or_error ( infcx) ) ;
508+ debug ! ( "fully_normalize: select_all_or_error start" ) ;
509+ match fulfill_cx. select_all_or_error ( infcx) {
510+ Ok ( ( ) ) => { }
511+ Err ( e) => {
512+ debug ! ( "fully_normalize: error={:?}" , e) ;
513+ return Err ( e) ;
514+ }
515+ }
516+ debug ! ( "fully_normalize: select_all_or_error complete" ) ;
502517 let resolved_value = infcx. resolve_type_vars_if_possible ( & normalized_value) ;
503- debug ! ( "normalize_param_env : resolved_value={:?}" , resolved_value) ;
518+ debug ! ( "fully_normalize : resolved_value={:?}" , resolved_value) ;
504519 Ok ( resolved_value)
505520}
506521
0 commit comments