@@ -59,6 +59,21 @@ pub struct MemPlace<Tag: Provenance = AllocId> {
5959#[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
6060rustc_data_structures:: static_assert_size!( MemPlace , 40 ) ;
6161
62+ /// A MemPlace with its layout. Constructing it is only possible in this module.
63+ #[ derive( Copy , Clone , Hash , Eq , PartialEq , Debug ) ]
64+ pub struct MPlaceTy < ' tcx , Tag : Provenance = AllocId > {
65+ mplace : MemPlace < Tag > ,
66+ pub layout : TyAndLayout < ' tcx > ,
67+ /// rustc does not have a proper way to represent the type of a field of a `repr(packed)` struct:
68+ /// it needs to have a different alignment than the field type would usually have.
69+ /// So we represent this here with a separate field that "overwrites" `layout.align`.
70+ /// This means `layout.align` should never be used for a `MPlaceTy`!
71+ pub align : Align ,
72+ }
73+
74+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
75+ rustc_data_structures:: static_assert_size!( MPlaceTy <' _>, 64 ) ;
76+
6277#[ derive( Copy , Clone , Debug ) ]
6378pub enum Place < Tag : Provenance = AllocId > {
6479 /// A place referring to a value allocated in the `Memory` system.
@@ -72,7 +87,7 @@ pub enum Place<Tag: Provenance = AllocId> {
7287#[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
7388rustc_data_structures:: static_assert_size!( Place , 48 ) ;
7489
75- #[ derive( Copy , Clone , Debug ) ]
90+ #[ derive( Clone , Debug ) ]
7691pub struct PlaceTy < ' tcx , Tag : Provenance = AllocId > {
7792 place : Place < Tag > , // Keep this private; it helps enforce invariants.
7893 pub layout : TyAndLayout < ' tcx > ,
@@ -94,21 +109,6 @@ impl<'tcx, Tag: Provenance> std::ops::Deref for PlaceTy<'tcx, Tag> {
94109 }
95110}
96111
97- /// A MemPlace with its layout. Constructing it is only possible in this module.
98- #[ derive( Copy , Clone , Hash , Eq , PartialEq , Debug ) ]
99- pub struct MPlaceTy < ' tcx , Tag : Provenance = AllocId > {
100- mplace : MemPlace < Tag > ,
101- pub layout : TyAndLayout < ' tcx > ,
102- /// rustc does not have a proper way to represent the type of a field of a `repr(packed)` struct:
103- /// it needs to have a different alignment than the field type would usually have.
104- /// So we represent this here with a separate field that "overwrites" `layout.align`.
105- /// This means `layout.align` should never be used for a `MPlaceTy`!
106- pub align : Align ,
107- }
108-
109- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
110- rustc_data_structures:: static_assert_size!( MPlaceTy <' _>, 64 ) ;
111-
112112impl < ' tcx , Tag : Provenance > std:: ops:: Deref for MPlaceTy < ' tcx , Tag > {
113113 type Target = MemPlace < Tag > ;
114114 #[ inline( always) ]
0 commit comments