@@ -796,9 +796,6 @@ pub struct Place<'tcx> {
796
796
pub projection : & ' tcx List < PlaceElem < ' tcx > > ,
797
797
}
798
798
799
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
800
- static_assert_size ! ( Place <' _>, 16 ) ;
801
-
802
799
#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
803
800
#[ derive( TyEncodable , TyDecodable , HashStable ) ]
804
801
pub enum ProjectionElem < V , T > {
@@ -862,11 +859,6 @@ pub enum ProjectionElem<V, T> {
862
859
/// and the index is a local.
863
860
pub type PlaceElem < ' tcx > = ProjectionElem < Local , Ty < ' tcx > > ;
864
861
865
- // This type is fairly frequently used, so we shouldn't unintentionally increase
866
- // its size.
867
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
868
- static_assert_size ! ( PlaceElem <' _>, 24 ) ;
869
-
870
862
///////////////////////////////////////////////////////////////////////////
871
863
// Operands
872
864
@@ -909,9 +901,6 @@ pub enum Operand<'tcx> {
909
901
Constant ( Box < Constant < ' tcx > > ) ,
910
902
}
911
903
912
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
913
- static_assert_size ! ( Operand <' _>, 24 ) ;
914
-
915
904
///////////////////////////////////////////////////////////////////////////
916
905
// Rvalues
917
906
@@ -1063,9 +1052,6 @@ pub enum Rvalue<'tcx> {
1063
1052
CopyForDeref ( Place < ' tcx > ) ,
1064
1053
}
1065
1054
1066
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
1067
- static_assert_size ! ( Rvalue <' _>, 40 ) ;
1068
-
1069
1055
#[ derive( Clone , Copy , Debug , PartialEq , Eq , TyEncodable , TyDecodable , Hash , HashStable ) ]
1070
1056
pub enum CastKind {
1071
1057
/// An exposing pointer to address cast. A cast between a pointer and an integer type, or
@@ -1099,9 +1085,6 @@ pub enum AggregateKind<'tcx> {
1099
1085
Generator ( DefId , SubstsRef < ' tcx > , hir:: Movability ) ,
1100
1086
}
1101
1087
1102
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
1103
- static_assert_size ! ( AggregateKind <' _>, 48 ) ;
1104
-
1105
1088
#[ derive( Copy , Clone , Debug , PartialEq , Eq , TyEncodable , TyDecodable , Hash , HashStable ) ]
1106
1089
pub enum NullOp {
1107
1090
/// Returns the size of a value of that type
@@ -1165,3 +1148,15 @@ pub enum BinOp {
1165
1148
/// The `ptr.offset` operator
1166
1149
Offset ,
1167
1150
}
1151
+
1152
+ // Some nodes are used a lot. Make sure they don't unintentionally get bigger.
1153
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
1154
+ mod size_asserts {
1155
+ use super :: * ;
1156
+ // These are in alphabetical order, which is easy to maintain.
1157
+ static_assert_size ! ( AggregateKind <' _>, 48 ) ;
1158
+ static_assert_size ! ( Operand <' _>, 24 ) ;
1159
+ static_assert_size ! ( Place <' _>, 16 ) ;
1160
+ static_assert_size ! ( PlaceElem <' _>, 24 ) ;
1161
+ static_assert_size ! ( Rvalue <' _>, 40 ) ;
1162
+ }
0 commit comments