@@ -36,7 +36,7 @@ pub use init_mask::{InitChunk, InitChunkIter};
3636// hashed. (see the `Hash` impl below for more details), so the impl is not derived.
3737#[ derive( Clone , Eq , PartialEq , PartialOrd , Ord , TyEncodable , TyDecodable ) ]
3838#[ derive( HashStable ) ]
39- pub struct Allocation < Prov = AllocId , Extra = ( ) > {
39+ pub struct Allocation < Prov : Provenance = AllocId , Extra = ( ) > {
4040 /// The actual bytes of the allocation.
4141 /// Note that the bytes of a pointer represent the offset of the pointer.
4242 bytes : Box < [ u8 ] > ,
@@ -108,9 +108,7 @@ impl hash::Hash for Allocation {
108108/// (`ConstAllocation`) are used quite a bit.
109109#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , HashStable ) ]
110110#[ 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 > ) ;
114112
115113impl < ' tcx > fmt:: Debug for ConstAllocation < ' tcx > {
116114 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -120,8 +118,8 @@ impl<'tcx> fmt::Debug for ConstAllocation<'tcx> {
120118 }
121119}
122120
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 {
125123 self . 0 . 0
126124 }
127125}
@@ -220,7 +218,7 @@ impl AllocRange {
220218}
221219
222220// 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 > {
224222 /// Creates an allocation initialized by the given bytes
225223 pub fn from_bytes < ' a > (
226224 slice : impl Into < Cow < ' a , [ u8 ] > > ,
@@ -278,7 +276,7 @@ impl<Prov> Allocation<Prov> {
278276impl Allocation {
279277 /// Adjust allocation from the ones in tcx to a custom Machine instance
280278 /// 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 > (
282280 self ,
283281 cx : & impl HasDataLayout ,
284282 extra : Extra ,
@@ -311,7 +309,7 @@ impl Allocation {
311309}
312310
313311/// Raw accessors. Provide access to otherwise private bytes.
314- impl < Prov , Extra > Allocation < Prov , Extra > {
312+ impl < Prov : Provenance , Extra > Allocation < Prov , Extra > {
315313 pub fn len ( & self ) -> usize {
316314 self . bytes . len ( )
317315 }
0 commit comments