@@ -390,6 +390,7 @@ pub fn normalize_param_env_or_error<'tcx>(
390
390
}
391
391
392
392
/// Normalize a type and process all resulting obligations, returning any errors
393
+ #[ instrument( skip_all) ]
393
394
pub fn fully_normalize < ' tcx , T > (
394
395
infcx : & InferCtxt < ' tcx > ,
395
396
cause : ObligationCause < ' tcx > ,
@@ -399,28 +400,18 @@ pub fn fully_normalize<'tcx, T>(
399
400
where
400
401
T : TypeFoldable < ' tcx > ,
401
402
{
402
- debug ! ( "fully_normalize_with_fulfillcx(value={:?})" , value) ;
403
- let selcx = & mut SelectionContext :: new ( infcx) ;
404
- let Normalized { value : normalized_value, obligations } =
405
- project:: normalize ( selcx, param_env, cause, value) ;
406
- debug ! (
407
- "fully_normalize: normalized_value={:?} obligations={:?}" ,
408
- normalized_value, obligations
409
- ) ;
410
-
411
- let mut fulfill_cx = FulfillmentContext :: new ( ) ;
412
- for obligation in obligations {
413
- fulfill_cx. register_predicate_obligation ( infcx, obligation) ;
414
- }
415
-
416
- debug ! ( "fully_normalize: select_all_or_error start" ) ;
417
- let errors = fulfill_cx. select_all_or_error ( infcx) ;
403
+ let ocx = ObligationCtxt :: new ( infcx) ;
404
+ debug ! ( ?value) ;
405
+ let normalized_value = ocx. normalize ( cause, param_env, value) ;
406
+ debug ! ( ?normalized_value) ;
407
+ debug ! ( "select_all_or_error start" ) ;
408
+ let errors = ocx. select_all_or_error ( ) ;
418
409
if !errors. is_empty ( ) {
419
410
return Err ( errors) ;
420
411
}
421
- debug ! ( "fully_normalize: select_all_or_error complete" ) ;
412
+ debug ! ( "select_all_or_error complete" ) ;
422
413
let resolved_value = infcx. resolve_vars_if_possible ( normalized_value) ;
423
- debug ! ( "fully_normalize: resolved_value={:?}" , resolved_value) ;
414
+ debug ! ( ? resolved_value) ;
424
415
Ok ( resolved_value)
425
416
}
426
417
0 commit comments