@@ -568,6 +568,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
568
568
/// - `substs`, the substs used to instantiate this opaque type
569
569
/// - `instantiated_ty`, the inferred type C1 -- fully resolved, lifted version of
570
570
/// `opaque_defn.concrete_ty`
571
+ #[ instrument( skip( self ) ) ]
571
572
fn infer_opaque_definition_from_instantiation (
572
573
& self ,
573
574
opaque_type_key : OpaqueTypeKey < ' tcx > ,
@@ -576,18 +577,14 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
576
577
) -> Ty < ' tcx > {
577
578
let OpaqueTypeKey { def_id, substs } = opaque_type_key;
578
579
579
- debug ! (
580
- "infer_opaque_definition_from_instantiation(def_id={:?}, instantiated_ty={:?})" ,
581
- def_id, instantiated_ty
582
- ) ;
583
-
584
580
// Use substs to build up a reverse map from regions to their
585
581
// identity mappings. This is necessary because of `impl
586
582
// Trait` lifetimes are computed by replacing existing
587
583
// lifetimes with 'static and remapping only those used in the
588
584
// `impl Trait` return type, resulting in the parameters
589
585
// shifting.
590
586
let id_substs = InternalSubsts :: identity_for_item ( self . tcx , def_id) ;
587
+ debug ! ( ?id_substs) ;
591
588
let map: FxHashMap < GenericArg < ' tcx > , GenericArg < ' tcx > > =
592
589
substs. iter ( ) . enumerate ( ) . map ( |( index, subst) | ( subst, id_substs[ index] ) ) . collect ( ) ;
593
590
@@ -602,7 +599,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
602
599
instantiated_ty,
603
600
span,
604
601
) ) ;
605
- debug ! ( "infer_opaque_definition_from_instantiation: definition_ty={:?}" , definition_ty) ;
602
+ debug ! ( ? definition_ty) ;
606
603
607
604
definition_ty
608
605
}
@@ -857,14 +854,15 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
857
854
self . tcx . mk_generator ( def_id, substs, movability)
858
855
}
859
856
860
- ty:: Param ( .. ) => {
857
+ ty:: Param ( param ) => {
861
858
// Look it up in the substitution list.
862
859
match self . map . get ( & ty. into ( ) ) . map ( |k| k. unpack ( ) ) {
863
860
// Found it in the substitution list; replace with the parameter from the
864
861
// opaque type.
865
862
Some ( GenericArgKind :: Type ( t1) ) => t1,
866
863
Some ( u) => panic ! ( "type mapped to unexpected kind: {:?}" , u) ,
867
864
None => {
865
+ debug ! ( ?param, ?self . map) ;
868
866
self . tcx
869
867
. sess
870
868
. struct_span_err (
@@ -931,8 +929,8 @@ struct Instantiator<'a, 'tcx> {
931
929
}
932
930
933
931
impl < ' a , ' tcx > Instantiator < ' a , ' tcx > {
932
+ #[ instrument( skip( self ) ) ]
934
933
fn instantiate_opaque_types_in_map < T : TypeFoldable < ' tcx > > ( & mut self , value : T ) -> T {
935
- debug ! ( "instantiate_opaque_types_in_map(value={:?})" , value) ;
936
934
let tcx = self . infcx . tcx ;
937
935
value. fold_with ( & mut BottomUpFolder {
938
936
tcx,
0 commit comments