@@ -368,11 +368,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
368
368
let fn_sig = tcx. fn_sig ( def_id) ;
369
369
let fn_sig = self . replace_bound_vars_with_fresh_vars ( span, infer:: FnCall , & fn_sig) . 0 ;
370
370
let fn_sig = fn_sig. subst ( self . tcx , substs) ;
371
- let fn_sig = match self . normalize_associated_types_in_as_infer_ok ( span, & fn_sig) {
372
- InferOk { value, obligations : o } => {
373
- obligations. extend ( o) ;
374
- value
375
- }
371
+
372
+ let InferOk { value, obligations : o } =
373
+ self . normalize_associated_types_in_as_infer_ok ( span, & fn_sig) ;
374
+ let fn_sig = {
375
+ obligations. extend ( o) ;
376
+ value
376
377
} ;
377
378
378
379
// Register obligations for the parameters. This will include the
@@ -384,12 +385,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
384
385
// Note that as the method comes from a trait, it should not have
385
386
// any late-bound regions appearing in its bounds.
386
387
let bounds = self . tcx . predicates_of ( def_id) . instantiate ( self . tcx , substs) ;
387
- let bounds = match self . normalize_associated_types_in_as_infer_ok ( span, & bounds) {
388
- InferOk { value, obligations : o } => {
389
- obligations. extend ( o) ;
390
- value
391
- }
388
+
389
+ let InferOk { value, obligations : o } =
390
+ self . normalize_associated_types_in_as_infer_ok ( span, & bounds) ;
391
+ let bounds = {
392
+ obligations. extend ( o) ;
393
+ value
392
394
} ;
395
+
393
396
assert ! ( !bounds. has_escaping_bound_vars( ) ) ;
394
397
395
398
let cause = traits:: ObligationCause :: misc ( span, self . body_id ) ;
0 commit comments