@@ -19,7 +19,7 @@ fn check_representability(tcx: TyCtxt<'_>, def_id: LocalDefId) {
1919 DefKind :: Struct | DefKind :: Union | DefKind :: Enum => {
2020 for variant in tcx. adt_def ( def_id) . variants ( ) {
2121 for field in variant. fields . iter ( ) {
22- let _ = tcx. check_representability ( field. did . expect_local ( ) ) ;
22+ tcx. ensure_ok ( ) . check_representability ( field. did . expect_local ( ) ) ;
2323 }
2424 }
2525 }
@@ -35,7 +35,7 @@ fn check_representability_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) {
3535 // This one must be a query rather than a vanilla `check_representability_adt_ty` call. See
3636 // the comment on `check_representability_adt_ty` below for why.
3737 ty:: Adt ( ..) => {
38- let _ = tcx. check_representability_adt_ty ( ty) ;
38+ tcx. ensure_ok ( ) . check_representability_adt_ty ( ty) ;
3939 }
4040 // FIXME(#11924) allow zero-length arrays?
4141 ty:: Array ( ty, _) => {
@@ -69,7 +69,7 @@ fn check_representability_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) {
6969fn check_representability_adt_ty < ' tcx > ( tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > ) {
7070 let ty:: Adt ( adt, args) = ty. kind ( ) else { bug ! ( "expected adt" ) } ;
7171 if let Some ( def_id) = adt. did ( ) . as_local ( ) {
72- let _ = tcx. check_representability ( def_id) ;
72+ tcx. ensure_ok ( ) . check_representability ( def_id) ;
7373 }
7474 // At this point, we know that the item of the ADT type is representable;
7575 // but the type parameters may cause a cycle with an upstream type
0 commit comments