@@ -552,13 +552,13 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
552
552
/// # Parameters
553
553
///
554
554
/// - `def_id`, the `impl Trait` type
555
- /// - `opaque_defn `, the opaque definition created in `instantiate_opaque_types`
555
+ /// - `substs `, the substs used to instantiate this opaque type
556
556
/// - `instantiated_ty`, the inferred type C1 -- fully resolved, lifted version of
557
557
/// `opaque_defn.concrete_ty`
558
558
pub fn infer_opaque_definition_from_instantiation (
559
559
& self ,
560
560
def_id : DefId ,
561
- opaque_defn : & OpaqueTypeDecl < ' tcx > ,
561
+ substs : SubstsRef < ' tcx > ,
562
562
instantiated_ty : Ty < ' tcx > ,
563
563
span : Span ,
564
564
) -> Ty < ' tcx > {
@@ -574,12 +574,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
574
574
// `impl Trait` return type, resulting in the parameters
575
575
// shifting.
576
576
let id_substs = InternalSubsts :: identity_for_item ( self . tcx , def_id) ;
577
- let map: FxHashMap < GenericArg < ' tcx > , GenericArg < ' tcx > > = opaque_defn
578
- . substs
579
- . iter ( )
580
- . enumerate ( )
581
- . map ( |( index, subst) | ( * subst, id_substs[ index] ) )
582
- . collect ( ) ;
577
+ let map: FxHashMap < GenericArg < ' tcx > , GenericArg < ' tcx > > =
578
+ substs. iter ( ) . enumerate ( ) . map ( |( index, subst) | ( * subst, id_substs[ index] ) ) . collect ( ) ;
583
579
584
580
// Convert the type from the function into a type valid outside
585
581
// the function, by replacing invalid regions with 'static,
0 commit comments