@@ -552,13 +552,13 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
552552 /// # Parameters
553553 ///
554554 /// - `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
556556 /// - `instantiated_ty`, the inferred type C1 -- fully resolved, lifted version of
557557 /// `opaque_defn.concrete_ty`
558558 pub fn infer_opaque_definition_from_instantiation (
559559 & self ,
560560 def_id : DefId ,
561- opaque_defn : & OpaqueTypeDecl < ' tcx > ,
561+ substs : SubstsRef < ' tcx > ,
562562 instantiated_ty : Ty < ' tcx > ,
563563 span : Span ,
564564 ) -> Ty < ' tcx > {
@@ -574,12 +574,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
574574 // `impl Trait` return type, resulting in the parameters
575575 // shifting.
576576 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 ( ) ;
583579
584580 // Convert the type from the function into a type valid outside
585581 // the function, by replacing invalid regions with 'static,
0 commit comments