@@ -36,7 +36,7 @@ pub use init_mask::{InitChunk, InitChunkIter};
36
36
// hashed. (see the `Hash` impl below for more details), so the impl is not derived.
37
37
#[ derive( Clone , Eq , PartialEq , PartialOrd , Ord , TyEncodable , TyDecodable ) ]
38
38
#[ derive( HashStable ) ]
39
- pub struct Allocation < Prov = AllocId , Extra = ( ) > {
39
+ pub struct Allocation < Prov : Provenance = AllocId , Extra = ( ) > {
40
40
/// The actual bytes of the allocation.
41
41
/// Note that the bytes of a pointer represent the offset of the pointer.
42
42
bytes : Box < [ u8 ] > ,
@@ -108,9 +108,7 @@ impl hash::Hash for Allocation {
108
108
/// (`ConstAllocation`) are used quite a bit.
109
109
#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , HashStable ) ]
110
110
#[ rustc_pass_by_value]
111
- pub struct ConstAllocation < ' tcx , Prov = AllocId , Extra = ( ) > (
112
- pub Interned < ' tcx , Allocation < Prov , Extra > > ,
113
- ) ;
111
+ pub struct ConstAllocation < ' tcx > ( pub Interned < ' tcx , Allocation > ) ;
114
112
115
113
impl < ' tcx > fmt:: Debug for ConstAllocation < ' tcx > {
116
114
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -120,8 +118,8 @@ impl<'tcx> fmt::Debug for ConstAllocation<'tcx> {
120
118
}
121
119
}
122
120
123
- impl < ' tcx , Prov , Extra > ConstAllocation < ' tcx , Prov , Extra > {
124
- pub fn inner ( self ) -> & ' tcx Allocation < Prov , Extra > {
121
+ impl < ' tcx > ConstAllocation < ' tcx > {
122
+ pub fn inner ( self ) -> & ' tcx Allocation {
125
123
self . 0 . 0
126
124
}
127
125
}
@@ -220,7 +218,7 @@ impl AllocRange {
220
218
}
221
219
222
220
// The constructors are all without extra; the extra gets added by a machine hook later.
223
- impl < Prov > Allocation < Prov > {
221
+ impl < Prov : Provenance > Allocation < Prov > {
224
222
/// Creates an allocation initialized by the given bytes
225
223
pub fn from_bytes < ' a > (
226
224
slice : impl Into < Cow < ' a , [ u8 ] > > ,
@@ -278,7 +276,7 @@ impl<Prov> Allocation<Prov> {
278
276
impl Allocation {
279
277
/// Adjust allocation from the ones in tcx to a custom Machine instance
280
278
/// with a different Provenance and Extra type.
281
- pub fn adjust_from_tcx < Prov , Extra , Err > (
279
+ pub fn adjust_from_tcx < Prov : Provenance , Extra , Err > (
282
280
self ,
283
281
cx : & impl HasDataLayout ,
284
282
extra : Extra ,
@@ -311,7 +309,7 @@ impl Allocation {
311
309
}
312
310
313
311
/// Raw accessors. Provide access to otherwise private bytes.
314
- impl < Prov , Extra > Allocation < Prov , Extra > {
312
+ impl < Prov : Provenance , Extra > Allocation < Prov , Extra > {
315
313
pub fn len ( & self ) -> usize {
316
314
self . bytes . len ( )
317
315
}
0 commit comments