@@ -839,10 +839,6 @@ pub struct LocalDecl<'tcx> {
839
839
pub source_info : SourceInfo ,
840
840
}
841
841
842
- // `LocalDecl` is used a lot. Make sure it doesn't unintentionally get bigger.
843
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
844
- static_assert_size ! ( LocalDecl <' _>, 56 ) ;
845
-
846
842
/// Extra information about a some locals that's used for diagnostics and for
847
843
/// classifying variables into local variables, statics, etc, which is needed e.g.
848
844
/// for unsafety checking.
@@ -1317,10 +1313,6 @@ pub struct Statement<'tcx> {
1317
1313
pub kind : StatementKind < ' tcx > ,
1318
1314
}
1319
1315
1320
- // `Statement` is used a lot. Make sure it doesn't unintentionally get bigger.
1321
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
1322
- static_assert_size ! ( Statement <' _>, 32 ) ;
1323
-
1324
1316
impl Statement < ' _ > {
1325
1317
/// Changes a statement to a nop. This is both faster than deleting instructions and avoids
1326
1318
/// invalidating statement indices in `Location`s.
@@ -2900,3 +2892,17 @@ impl Location {
2900
2892
}
2901
2893
}
2902
2894
}
2895
+
2896
+ // Some nodes are used a lot. Make sure they don't unintentionally get bigger.
2897
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
2898
+ mod size_asserts {
2899
+ use super :: * ;
2900
+ use rustc_data_structures:: static_assert_size;
2901
+ // These are in alphabetical order, which is easy to maintain.
2902
+ static_assert_size ! ( BasicBlockData <' _>, 144 ) ;
2903
+ static_assert_size ! ( LocalDecl <' _>, 56 ) ;
2904
+ static_assert_size ! ( Statement <' _>, 32 ) ;
2905
+ static_assert_size ! ( StatementKind <' _>, 16 ) ;
2906
+ static_assert_size ! ( Terminator <' _>, 112 ) ;
2907
+ static_assert_size ! ( TerminatorKind <' _>, 96 ) ;
2908
+ }
0 commit comments