@@ -800,9 +800,6 @@ pub struct Place<'tcx> {
800
800
pub projection : & ' tcx List < PlaceElem < ' tcx > > ,
801
801
}
802
802
803
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
804
- static_assert_size ! ( Place <' _>, 16 ) ;
805
-
806
803
#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
807
804
#[ derive( TyEncodable , TyDecodable , HashStable ) ]
808
805
pub enum ProjectionElem < V , T > {
@@ -866,11 +863,6 @@ pub enum ProjectionElem<V, T> {
866
863
/// and the index is a local.
867
864
pub type PlaceElem < ' tcx > = ProjectionElem < Local , Ty < ' tcx > > ;
868
865
869
- // This type is fairly frequently used, so we shouldn't unintentionally increase
870
- // its size.
871
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
872
- static_assert_size ! ( PlaceElem <' _>, 24 ) ;
873
-
874
866
///////////////////////////////////////////////////////////////////////////
875
867
// Operands
876
868
@@ -913,9 +905,6 @@ pub enum Operand<'tcx> {
913
905
Constant ( Box < Constant < ' tcx > > ) ,
914
906
}
915
907
916
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
917
- static_assert_size ! ( Operand <' _>, 24 ) ;
918
-
919
908
///////////////////////////////////////////////////////////////////////////
920
909
// Rvalues
921
910
@@ -1067,9 +1056,6 @@ pub enum Rvalue<'tcx> {
1067
1056
CopyForDeref ( Place < ' tcx > ) ,
1068
1057
}
1069
1058
1070
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
1071
- static_assert_size ! ( Rvalue <' _>, 40 ) ;
1072
-
1073
1059
#[ derive( Clone , Copy , Debug , PartialEq , Eq , TyEncodable , TyDecodable , Hash , HashStable ) ]
1074
1060
pub enum CastKind {
1075
1061
/// An exposing pointer to address cast. A cast between a pointer and an integer type, or
@@ -1105,9 +1091,6 @@ pub enum AggregateKind<'tcx> {
1105
1091
Generator ( LocalDefId , SubstsRef < ' tcx > , hir:: Movability ) ,
1106
1092
}
1107
1093
1108
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
1109
- static_assert_size ! ( AggregateKind <' _>, 48 ) ;
1110
-
1111
1094
#[ derive( Copy , Clone , Debug , PartialEq , Eq , TyEncodable , TyDecodable , Hash , HashStable ) ]
1112
1095
pub enum NullOp {
1113
1096
/// Returns the size of a value of that type
@@ -1171,3 +1154,15 @@ pub enum BinOp {
1171
1154
/// The `ptr.offset` operator
1172
1155
Offset ,
1173
1156
}
1157
+
1158
+ // Some nodes are used a lot. Make sure they don't unintentionally get bigger.
1159
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
1160
+ mod size_asserts {
1161
+ use super :: * ;
1162
+ // These are in alphabetical order, which is easy to maintain.
1163
+ static_assert_size ! ( AggregateKind <' _>, 48 ) ;
1164
+ static_assert_size ! ( Operand <' _>, 24 ) ;
1165
+ static_assert_size ! ( Place <' _>, 16 ) ;
1166
+ static_assert_size ! ( PlaceElem <' _>, 24 ) ;
1167
+ static_assert_size ! ( Rvalue <' _>, 40 ) ;
1168
+ }
0 commit comments