File tree 3 files changed +14
-0
lines changed
3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ pub struct Pointer<Tag=(),Id=AllocId> {
76
76
pub tag : Tag ,
77
77
}
78
78
79
+ static_assert ! ( POINTER_SIZE : :: std:: mem:: size_of:: <Pointer >( ) == 16 ) ;
80
+
79
81
/// Produces a `Pointer` which points to the beginning of the Allocation
80
82
impl From < AllocId > for Pointer {
81
83
#[ inline( always) ]
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ pub enum ConstValue<'tcx> {
32
32
ByRef ( AllocId , & ' tcx Allocation , Size ) ,
33
33
}
34
34
35
+ #[ cfg( target_arch = "x86_64" ) ]
36
+ static_assert ! ( CONST_SIZE : :: std:: mem:: size_of:: <ConstValue <' static >>( ) == 56 ) ;
37
+
35
38
impl < ' tcx > ConstValue < ' tcx > {
36
39
#[ inline]
37
40
pub fn try_to_scalar ( & self ) -> Option < Scalar > {
@@ -90,6 +93,9 @@ pub enum Scalar<Tag=(), Id=AllocId> {
90
93
Ptr ( Pointer < Tag , Id > ) ,
91
94
}
92
95
96
+ #[ cfg( target_arch = "x86_64" ) ]
97
+ static_assert ! ( SCALAR_SIZE : :: std:: mem:: size_of:: <Scalar >( ) == 24 ) ;
98
+
93
99
impl < Tag > fmt:: Display for Scalar < Tag > {
94
100
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
95
101
match self {
Original file line number Diff line number Diff line change @@ -2063,6 +2063,9 @@ pub enum LazyConst<'tcx> {
2063
2063
Evaluated ( Const < ' tcx > ) ,
2064
2064
}
2065
2065
2066
+ #[ cfg( target_arch = "x86_64" ) ]
2067
+ static_assert ! ( LAZY_CONST_SIZE : :: std:: mem:: size_of:: <LazyConst <' static >>( ) == 72 ) ;
2068
+
2066
2069
impl < ' tcx > LazyConst < ' tcx > {
2067
2070
pub fn map_evaluated < R > ( self , f : impl FnOnce ( Const < ' tcx > ) -> Option < R > ) -> Option < R > {
2068
2071
match self {
@@ -2089,6 +2092,9 @@ pub struct Const<'tcx> {
2089
2092
pub val : ConstValue < ' tcx > ,
2090
2093
}
2091
2094
2095
+ #[ cfg( target_arch = "x86_64" ) ]
2096
+ static_assert ! ( CONST_SIZE : :: std:: mem:: size_of:: <Const <' static >>( ) == 64 ) ;
2097
+
2092
2098
impl < ' tcx > Const < ' tcx > {
2093
2099
#[ inline]
2094
2100
pub fn from_scalar (
You can’t perform that action at this time.
0 commit comments