@@ -59,6 +59,21 @@ pub struct MemPlace<Tag: Provenance = AllocId> {
59
59
#[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
60
60
rustc_data_structures:: static_assert_size!( MemPlace , 40 ) ;
61
61
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
+
62
77
#[ derive( Copy , Clone , Debug ) ]
63
78
pub enum Place < Tag : Provenance = AllocId > {
64
79
/// A place referring to a value allocated in the `Memory` system.
@@ -72,7 +87,7 @@ pub enum Place<Tag: Provenance = AllocId> {
72
87
#[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
73
88
rustc_data_structures:: static_assert_size!( Place , 48 ) ;
74
89
75
- #[ derive( Copy , Clone , Debug ) ]
90
+ #[ derive( Clone , Debug ) ]
76
91
pub struct PlaceTy < ' tcx , Tag : Provenance = AllocId > {
77
92
place : Place < Tag > , // Keep this private; it helps enforce invariants.
78
93
pub layout : TyAndLayout < ' tcx > ,
@@ -94,21 +109,6 @@ impl<'tcx, Tag: Provenance> std::ops::Deref for PlaceTy<'tcx, Tag> {
94
109
}
95
110
}
96
111
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
-
112
112
impl < ' tcx , Tag : Provenance > std:: ops:: Deref for MPlaceTy < ' tcx , Tag > {
113
113
type Target = MemPlace < Tag > ;
114
114
#[ inline( always) ]
0 commit comments