@@ -550,13 +550,13 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
550
550
/// # Parameters
551
551
///
552
552
/// - `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
554
554
/// - `instantiated_ty`, the inferred type C1 -- fully resolved, lifted version of
555
555
/// `opaque_defn.concrete_ty`
556
556
pub fn infer_opaque_definition_from_instantiation (
557
557
& self ,
558
558
def_id : DefId ,
559
- opaque_defn : & OpaqueTypeDecl < ' tcx > ,
559
+ substs : SubstsRef < ' tcx > ,
560
560
instantiated_ty : Ty < ' tcx > ,
561
561
span : Span ,
562
562
) -> Ty < ' tcx > {
@@ -572,12 +572,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
572
572
// `impl Trait` return type, resulting in the parameters
573
573
// shifting.
574
574
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 ( ) ;
581
577
582
578
// Convert the type from the function into a type valid outside
583
579
// the function, by replacing invalid regions with 'static,
0 commit comments