@@ -168,7 +168,12 @@ fn check_union_fields(tcx: TyCtxt<'_>, span: Span, item_def_id: LocalDefId) -> b
168168 let args = ty:: GenericArgs :: identity_for_item ( tcx, item_def_id) ;
169169
170170 for field in & def. non_enum_variant ( ) . fields {
171- if !allowed_union_or_unsafe_field ( tcx, field. ty ( tcx, args) , typing_env, span) {
171+ if !allowed_union_or_unsafe_field (
172+ tcx,
173+ field. ty ( tcx, args) . skip_norm_wip ( ) ,
174+ typing_env,
175+ span,
176+ ) {
172177 let ( field_span, ty_span) = match tcx. hir_get_if_local ( field. did ) {
173178 // We are currently checking the type this field came from, so it must be local.
174179 Some ( Node :: Field ( field) ) => ( field. span , field. ty . span ) ,
@@ -738,7 +743,7 @@ fn is_enum_of_nonnullable_ptr<'tcx>(
738743 let ( ( [ ] , [ field] ) | ( [ field] , [ ] ) ) = ( & var_one. fields . raw [ ..] , & var_two. fields . raw [ ..] ) else {
739744 return false ;
740745 } ;
741- matches ! ( field. ty( tcx, args) . kind( ) , ty:: FnPtr ( ..) | ty:: Ref ( ..) )
746+ matches ! ( field. ty( tcx, args) . skip_norm_wip ( ) . kind( ) , ty:: FnPtr ( ..) | ty:: Ref ( ..) )
742747}
743748
744749fn check_static_linkage ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
@@ -1440,7 +1445,7 @@ fn check_simd(tcx: TyCtxt<'_>, sp: Span, def_id: LocalDefId) {
14401445 }
14411446
14421447 let array_field = & fields[ FieldIdx :: ZERO ] ;
1443- let array_ty = array_field. ty ( tcx, args) ;
1448+ let array_ty = array_field. ty ( tcx, args) . skip_norm_wip ( ) ;
14441449 let ty:: Array ( element_ty, len_const) = array_ty. kind ( ) else {
14451450 struct_span_code_err ! (
14461451 tcx. dcx( ) ,
@@ -1545,7 +1550,7 @@ fn check_scalable_vector(tcx: TyCtxt<'_>, span: Span, def_id: LocalDefId, scalab
15451550
15461551 match scalable {
15471552 ScalableElt :: ElementCount ( ..) => {
1548- let element_ty = & fields[ FieldIdx :: ZERO ] . ty ( tcx, args) ;
1553+ let element_ty = & fields[ FieldIdx :: ZERO ] . ty ( tcx, args) . skip_norm_wip ( ) ;
15491554
15501555 // Check that `element_ty` only uses types valid in the lanes of a scalable vector
15511556 // register: scalar types which directly match a "machine" type - integers, floats and
@@ -1565,7 +1570,7 @@ fn check_scalable_vector(tcx: TyCtxt<'_>, span: Span, def_id: LocalDefId, scalab
15651570 ScalableElt :: Container => {
15661571 let mut prev_field_ty = None ;
15671572 for field in fields. iter ( ) {
1568- let element_ty = field. ty ( tcx, args) ;
1573+ let element_ty = field. ty ( tcx, args) . skip_norm_wip ( ) ;
15691574 if let ty:: Adt ( def, _) = element_ty. kind ( )
15701575 && def. repr ( ) . scalable ( )
15711576 {
@@ -1683,7 +1688,7 @@ pub(super) fn check_packed_inner(
16831688
16841689 stack. push ( def_id) ;
16851690 for field in & def. non_enum_variant ( ) . fields {
1686- if let ty:: Adt ( def, _) = field. ty ( tcx, args) . kind ( )
1691+ if let ty:: Adt ( def, _) = field. ty ( tcx, args) . skip_norm_wip ( ) . kind ( )
16871692 && !stack. contains ( & def. did ( ) )
16881693 && let Some ( mut defs) = check_packed_inner ( tcx, def. did ( ) , stack)
16891694 {
@@ -1761,7 +1766,7 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
17611766 }
17621767
17631768 let field_infos = adt. all_fields ( ) . map ( |field| {
1764- let ty = field. ty ( tcx, GenericArgs :: identity_for_item ( tcx, field. did ) ) ;
1769+ let ty = field. ty ( tcx, GenericArgs :: identity_for_item ( tcx, field. did ) ) . skip_norm_wip ( ) ;
17651770 let layout = tcx. layout_of ( typing_env. as_query_input ( ty) ) ;
17661771 // We are currently checking the type this field came from, so it must be local
17671772 let span = tcx. hir_span_if_local ( field. did ) . unwrap ( ) ;
@@ -1828,7 +1833,7 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
18281833 return ControlFlow :: Break ( UnsuitedInfo { ty, reason : UnsuitedReason :: ReprC } ) ;
18291834 }
18301835 def. all_fields ( )
1831- . map ( |field| field. ty ( tcx, args) )
1836+ . map ( |field| field. ty ( tcx, args) . skip_norm_wip ( ) )
18321837 . try_for_each ( |t| check_unsuited ( tcx, typing_env, t) )
18331838 }
18341839 _ => ControlFlow :: Continue ( ( ) ) ,
0 commit comments