File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ pub struct Pointer<Tag=(),Id=AllocId> {
7676 pub tag : Tag ,
7777}
7878
79+ static_assert ! ( POINTER_SIZE : :: std:: mem:: size_of:: <Pointer >( ) == 16 ) ;
80+
7981/// Produces a `Pointer` which points to the beginning of the Allocation
8082impl From < AllocId > for Pointer {
8183 #[ inline( always) ]
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ pub enum ConstValue<'tcx> {
3232 ByRef ( AllocId , & ' tcx Allocation , Size ) ,
3333}
3434
35+ #[ cfg( target_arch = "x86_64" ) ]
36+ static_assert ! ( CONST_SIZE : :: std:: mem:: size_of:: <ConstValue <' static >>( ) == 56 ) ;
37+
3538impl < ' tcx > ConstValue < ' tcx > {
3639 #[ inline]
3740 pub fn try_to_scalar ( & self ) -> Option < Scalar > {
@@ -90,6 +93,8 @@ pub enum Scalar<Tag=(), Id=AllocId> {
9093 Ptr ( Pointer < Tag , Id > ) ,
9194}
9295
96+ static_assert ! ( SCALAR_SIZE : :: std:: mem:: size_of:: <Scalar >( ) == 24 ) ;
97+
9398impl < Tag > fmt:: Display for Scalar < Tag > {
9499 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
95100 match self {
Original file line number Diff line number Diff line change @@ -2063,6 +2063,9 @@ pub enum LazyConst<'tcx> {
20632063 Evaluated ( Const < ' tcx > ) ,
20642064}
20652065
2066+ #[ cfg( target_arch = "x86_64" ) ]
2067+ static_assert ! ( LAZY_CONST_SIZE : :: std:: mem:: size_of:: <LazyConst <' static >>( ) == 72 ) ;
2068+
20662069impl < ' tcx > LazyConst < ' tcx > {
20672070 pub fn map_evaluated < R > ( self , f : impl FnOnce ( Const < ' tcx > ) -> Option < R > ) -> Option < R > {
20682071 match self {
@@ -2089,6 +2092,9 @@ pub struct Const<'tcx> {
20892092 pub val : ConstValue < ' tcx > ,
20902093}
20912094
2095+ #[ cfg( target_arch = "x86_64" ) ]
2096+ static_assert ! ( CONST_SIZE : :: std:: mem:: size_of:: <Const <' static >>( ) == 64 ) ;
2097+
20922098impl < ' tcx > Const < ' tcx > {
20932099 #[ inline]
20942100 pub fn from_scalar (
You can’t perform that action at this time.
0 commit comments