@@ -820,10 +820,10 @@ where
820820 }
821821
822822 fn fold_ty ( & mut self , ty : Ty < ' tcx > ) -> Ty < ' tcx > {
823- if let ty:: Alias ( ty:: Projection , proj ) = ty. kind ( )
824- && self . cx ( ) . is_impl_trait_in_trait ( proj . def_id )
823+ if let & ty:: Alias ( proj @ ty:: AliasTy { kind : ty :: Projection { def_id } , .. } ) = ty. kind ( )
824+ && self . cx ( ) . is_impl_trait_in_trait ( def_id)
825825 {
826- if let Some ( ( ty, _) ) = self . types . get ( & proj . def_id ) {
826+ if let Some ( ( ty, _) ) = self . types . get ( & def_id) {
827827 return * ty;
828828 }
829829 //FIXME(RPITIT): Deny nested RPITIT in args too
@@ -832,11 +832,11 @@ where
832832 }
833833 // Replace with infer var
834834 let infer_ty = self . ocx . infcx . next_ty_var ( self . span ) ;
835- self . types . insert ( proj . def_id , ( infer_ty, proj. args ) ) ;
835+ self . types . insert ( def_id, ( infer_ty, proj. args ) ) ;
836836 // Recurse into bounds
837837 for ( pred, pred_span) in self
838838 . cx ( )
839- . explicit_item_bounds ( proj . def_id )
839+ . explicit_item_bounds ( def_id)
840840 . iter_instantiated_copied ( self . cx ( ) , proj. args )
841841 {
842842 let pred = pred. fold_with ( self ) ;
@@ -851,7 +851,7 @@ where
851851 ObligationCause :: new (
852852 self . span ,
853853 self . body_id ,
854- ObligationCauseCode :: WhereClause ( proj . def_id , pred_span) ,
854+ ObligationCauseCode :: WhereClause ( def_id, pred_span) ,
855855 ) ,
856856 self . param_env ,
857857 pred,
@@ -922,8 +922,12 @@ impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> {
922922 } else {
923923 let guar = match region. opt_param_def_id ( self . tcx , self . impl_m_def_id ) {
924924 Some ( def_id) => {
925- let return_span = if let ty:: Alias ( ty:: Opaque , opaque_ty) = self . ty . kind ( ) {
926- self . tcx . def_span ( opaque_ty. def_id )
925+ let return_span = if let & ty:: Alias ( ty:: AliasTy {
926+ kind : ty:: Opaque { def_id : opaque_ty_def_id } ,
927+ ..
928+ } ) = self . ty . kind ( )
929+ {
930+ self . tcx . def_span ( opaque_ty_def_id)
927931 } else {
928932 self . return_span
929933 } ;
@@ -2703,8 +2707,8 @@ fn param_env_with_gat_bounds<'tcx>(
27032707 let bound_vars = tcx. mk_bound_variable_kinds ( & bound_vars) ;
27042708
27052709 match normalize_impl_ty. kind ( ) {
2706- ty:: Alias ( ty:: Projection , proj )
2707- if proj . def_id == trait_ty. def_id && proj. args == rebased_args =>
2710+ & ty:: Alias ( proj @ ty:: AliasTy { kind : ty :: Projection { def_id } , .. } )
2711+ if def_id == trait_ty. def_id && proj. args == rebased_args =>
27082712 {
27092713 // Don't include this predicate if the projected type is
27102714 // exactly the same as the projection. This can occur in
@@ -2746,7 +2750,7 @@ fn try_report_async_mismatch<'tcx>(
27462750 return Ok ( ( ) ) ;
27472751 }
27482752
2749- let ty:: Alias ( ty:: Projection , ty:: AliasTy { def_id : async_future_def_id, .. } ) =
2753+ let ty:: Alias ( ty:: AliasTy { kind : ty:: Projection { def_id : async_future_def_id } , .. } ) =
27502754 * tcx. fn_sig ( trait_m. def_id ) . skip_binder ( ) . skip_binder ( ) . output ( ) . kind ( )
27512755 else {
27522756 bug ! ( "expected `async fn` to return an RPITIT" ) ;
0 commit comments