@@ -550,13 +550,13 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
550550 /// # Parameters
551551 ///
552552 /// - `def_id`, the `impl Trait` type
553- /// - `opaque_defn `, the opaque definition created in `instantiate_opaque_types`
553+ /// - `substs `, the substs used to instantiate this opaque type
554554 /// - `instantiated_ty`, the inferred type C1 -- fully resolved, lifted version of
555555 /// `opaque_defn.concrete_ty`
556556 pub fn infer_opaque_definition_from_instantiation (
557557 & self ,
558558 def_id : DefId ,
559- opaque_defn : & OpaqueTypeDecl < ' tcx > ,
559+ substs : SubstsRef < ' tcx > ,
560560 instantiated_ty : Ty < ' tcx > ,
561561 span : Span ,
562562 ) -> Ty < ' tcx > {
@@ -572,12 +572,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
572572 // `impl Trait` return type, resulting in the parameters
573573 // shifting.
574574 let id_substs = InternalSubsts :: identity_for_item ( self . tcx , def_id) ;
575- let map: FxHashMap < GenericArg < ' tcx > , GenericArg < ' tcx > > = opaque_defn
576- . substs
577- . iter ( )
578- . enumerate ( )
579- . map ( |( index, subst) | ( * subst, id_substs[ index] ) )
580- . collect ( ) ;
575+ let map: FxHashMap < GenericArg < ' tcx > , GenericArg < ' tcx > > =
576+ substs. iter ( ) . enumerate ( ) . map ( |( index, subst) | ( * subst, id_substs[ index] ) ) . collect ( ) ;
581577
582578 // Convert the type from the function into a type valid outside
583579 // the function, by replacing invalid regions with 'static,
0 commit comments