@@ -76,8 +76,6 @@ impl DepKind {
76
76
}
77
77
}
78
78
79
- static_assert_size ! ( DepKind , 2 ) ;
80
-
81
79
pub fn default_dep_kind_debug ( kind : DepKind , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
82
80
f. debug_struct ( "DepKind" ) . field ( "variant" , & kind. variant ) . finish ( )
83
81
}
@@ -97,15 +95,6 @@ pub struct DepNode {
97
95
pub hash : PackedFingerprint ,
98
96
}
99
97
100
- // We keep a lot of `DepNode`s in memory during compilation. It's not
101
- // required that their size stay the same, but we don't want to change
102
- // it inadvertently. This assert just ensures we're aware of any change.
103
- #[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
104
- static_assert_size ! ( DepNode , 18 ) ;
105
-
106
- #[ cfg( not( any( target_arch = "x86" , target_arch = "x86_64" ) ) ) ]
107
- static_assert_size ! ( DepNode , 24 ) ;
108
-
109
98
impl DepNode {
110
99
/// Creates a new, parameterless DepNode. This method will assert
111
100
/// that the DepNode corresponding to the given DepKind actually
@@ -316,3 +305,17 @@ unsafe impl StableOrd for WorkProductId {
316
305
// Fingerprint can use unstable (just a tuple of `u64`s), so WorkProductId can as well
317
306
const CAN_USE_UNSTABLE_SORT : bool = true ;
318
307
}
308
+
309
+ // Some types are used a lot. Make sure they don't unintentionally get bigger.
310
+ #[ cfg( target_pointer_width = "64" ) ]
311
+ mod size_asserts {
312
+ use super :: * ;
313
+ use rustc_data_structures:: static_assert_size;
314
+ // tidy-alphabetical-start
315
+ static_assert_size ! ( DepKind , 2 ) ;
316
+ #[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
317
+ static_assert_size ! ( DepNode , 18 ) ;
318
+ #[ cfg( not( any( target_arch = "x86" , target_arch = "x86_64" ) ) ) ]
319
+ static_assert_size ! ( DepNode , 24 ) ;
320
+ // tidy-alphabetical-end
321
+ }
0 commit comments