@@ -463,15 +463,6 @@ pub(crate) struct TyS<'tcx> {
463
463
outer_exclusive_binder : ty:: DebruijnIndex ,
464
464
}
465
465
466
- // `TyS` is used a lot. Make sure it doesn't unintentionally get bigger.
467
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
468
- static_assert_size ! ( TyS <' _>, 40 ) ;
469
-
470
- // We are actually storing a stable hash cache next to the type, so let's
471
- // also check the full size
472
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
473
- static_assert_size ! ( WithStableHash <TyS <' _>>, 56 ) ;
474
-
475
466
/// Use this rather than `TyS`, whenever possible.
476
467
#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , HashStable ) ]
477
468
#[ rustc_diagnostic_item = "Ty" ]
@@ -528,10 +519,6 @@ pub(crate) struct PredicateS<'tcx> {
528
519
outer_exclusive_binder : ty:: DebruijnIndex ,
529
520
}
530
521
531
- // This type is used a lot. Make sure it doesn't unintentionally get bigger.
532
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
533
- static_assert_size ! ( PredicateS <' _>, 56 ) ;
534
-
535
522
/// Use this rather than `PredicateS`, whenever possible.
536
523
#[ derive( Clone , Copy , PartialEq , Eq , Hash ) ]
537
524
#[ rustc_pass_by_value]
@@ -2534,3 +2521,14 @@ pub struct DestructuredConst<'tcx> {
2534
2521
pub variant : Option < VariantIdx > ,
2535
2522
pub fields : & ' tcx [ ty:: Const < ' tcx > ] ,
2536
2523
}
2524
+
2525
+ // Some types are used a lot. Make sure they don't unintentionally get bigger.
2526
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
2527
+ mod size_asserts {
2528
+ use super :: * ;
2529
+ use rustc_data_structures:: static_assert_size;
2530
+ // These are in alphabetical order, which is easy to maintain.
2531
+ static_assert_size ! ( PredicateS <' _>, 56 ) ;
2532
+ static_assert_size ! ( TyS <' _>, 40 ) ;
2533
+ static_assert_size ! ( WithStableHash <TyS <' _>>, 56 ) ;
2534
+ }
0 commit comments