@@ -34,7 +34,7 @@ pub struct MemPlace<Tag=(), Id=AllocId> {
3434 /// Metadata for unsized places. Interpretation is up to the type.
3535 /// Must not be present for sized types, but can be missing for unsized types
3636 /// (e.g. `extern type`).
37- pub extra : Option < Scalar < Tag , Id > > ,
37+ pub meta : Option < Scalar < Tag , Id > > ,
3838}
3939
4040#[ derive( Copy , Clone , Debug , Hash , PartialEq , Eq ) ]
@@ -97,7 +97,7 @@ impl MemPlace {
9797 MemPlace {
9898 ptr : self . ptr . with_default_tag ( ) ,
9999 align : self . align ,
100- extra : self . extra . map ( Scalar :: with_default_tag) ,
100+ meta : self . meta . map ( Scalar :: with_default_tag) ,
101101 }
102102 }
103103}
@@ -109,7 +109,7 @@ impl<Tag> MemPlace<Tag> {
109109 MemPlace {
110110 ptr : self . ptr . erase_tag ( ) ,
111111 align : self . align ,
112- extra : self . extra . map ( Scalar :: erase_tag) ,
112+ meta : self . meta . map ( Scalar :: erase_tag) ,
113113 }
114114 }
115115
@@ -118,7 +118,7 @@ impl<Tag> MemPlace<Tag> {
118118 MemPlace {
119119 ptr,
120120 align,
121- extra : None ,
121+ meta : None ,
122122 }
123123 }
124124
@@ -129,11 +129,11 @@ impl<Tag> MemPlace<Tag> {
129129
130130 #[ inline( always) ]
131131 pub fn to_scalar_ptr_align ( self ) -> ( Scalar < Tag > , Align ) {
132- assert ! ( self . extra . is_none( ) ) ;
132+ assert ! ( self . meta . is_none( ) ) ;
133133 ( self . ptr , self . align )
134134 }
135135
136- /// Extract the ptr part of the mplace
136+ /// metact the ptr part of the mplace
137137 #[ inline( always) ]
138138 pub fn to_ptr ( self ) -> EvalResult < ' tcx , Pointer < Tag > > {
139139 // At this point, we forget about the alignment information --
@@ -147,9 +147,9 @@ impl<Tag> MemPlace<Tag> {
147147 pub fn to_ref ( self ) -> Value < Tag > {
148148 // We ignore the alignment of the place here -- special handling for packed structs ends
149149 // at the `&` operator.
150- match self . extra {
150+ match self . meta {
151151 None => Value :: Scalar ( self . ptr . into ( ) ) ,
152- Some ( extra ) => Value :: ScalarPair ( self . ptr . into ( ) , extra . into ( ) ) ,
152+ Some ( meta ) => Value :: ScalarPair ( self . ptr . into ( ) , meta . into ( ) ) ,
153153 }
154154 }
155155}
@@ -175,10 +175,10 @@ impl<'tcx, Tag> MPlaceTy<'tcx, Tag> {
175175 #[ inline]
176176 pub ( super ) fn len ( self , cx : impl HasDataLayout ) -> EvalResult < ' tcx , u64 > {
177177 if self . layout . is_unsized ( ) {
178- // We need to consult `extra ` metadata
178+ // We need to consult `meta ` metadata
179179 match self . layout . ty . sty {
180180 ty:: Slice ( ..) | ty:: Str =>
181- return self . mplace . extra . unwrap ( ) . to_usize ( cx) ,
181+ return self . mplace . meta . unwrap ( ) . to_usize ( cx) ,
182182 _ => bug ! ( "len not supported on unsized type {:?}" , self . layout. ty) ,
183183 }
184184 } else {
@@ -194,7 +194,7 @@ impl<'tcx, Tag> MPlaceTy<'tcx, Tag> {
194194 #[ inline]
195195 pub ( super ) fn vtable ( self ) -> EvalResult < ' tcx , Pointer < Tag > > {
196196 match self . layout . ty . sty {
197- ty:: Dynamic ( ..) => self . mplace . extra . unwrap ( ) . to_ptr ( ) ,
197+ ty:: Dynamic ( ..) => self . mplace . meta . unwrap ( ) . to_ptr ( ) ,
198198 _ => bug ! ( "vtable not supported on type {:?}" , self . layout. ty) ,
199199 }
200200 }
283283 let align = layout. align ;
284284 let mplace = match * val {
285285 Value :: Scalar ( ptr) =>
286- MemPlace { ptr : ptr. not_undef ( ) ?, align, extra : None } ,
287- Value :: ScalarPair ( ptr, extra ) =>
288- MemPlace { ptr : ptr. not_undef ( ) ?, align, extra : Some ( extra . not_undef ( ) ?) } ,
286+ MemPlace { ptr : ptr. not_undef ( ) ?, align, meta : None } ,
287+ Value :: ScalarPair ( ptr, meta ) =>
288+ MemPlace { ptr : ptr. not_undef ( ) ?, align, meta : Some ( meta . not_undef ( ) ?) } ,
289289 } ;
290290 Ok ( MPlaceTy { mplace, layout } )
291291 }
@@ -321,13 +321,13 @@ impl
321321 let field_layout = base. layout . field ( self , usize:: try_from ( field) . unwrap_or ( 0 ) ) ?;
322322
323323 // Offset may need adjustment for unsized fields
324- let ( extra , offset) = if field_layout. is_unsized ( ) {
324+ let ( meta , offset) = if field_layout. is_unsized ( ) {
325325 // re-use parent metadata to determine dynamic field layout
326- let ( _, align) = self . size_and_align_of ( base. extra , field_layout) ?;
327- ( base. extra , offset. abi_align ( align) )
326+ let ( _, align) = self . size_and_align_of ( base. meta , field_layout) ?;
327+ ( base. meta , offset. abi_align ( align) )
328328
329329 } else {
330- // base.extra could be present; we might be accessing a sized field of an unsized
330+ // base.meta could be present; we might be accessing a sized field of an unsized
331331 // struct.
332332 ( None , offset)
333333 } ;
338338 // codegen -- mostly to see if we can get away with that
339339 . restrict_for_offset ( offset) ; // must be last thing that happens
340340
341- Ok ( MPlaceTy { mplace : MemPlace { ptr, align, extra } , layout : field_layout } )
341+ Ok ( MPlaceTy { mplace : MemPlace { ptr, align, meta } , layout : field_layout } )
342342 }
343343
344344 // Iterates over all fields of an array. Much more efficient than doing the
359359 Ok ( ( 0 ..len) . map ( move |i| {
360360 let ptr = base. ptr . ptr_offset ( i * stride, dl) ?;
361361 Ok ( MPlaceTy {
362- mplace : MemPlace { ptr, align : base. align , extra : None } ,
362+ mplace : MemPlace { ptr, align : base. align , meta : None } ,
363363 layout
364364 } )
365365 } ) )
383383 } ;
384384 let ptr = base. ptr . ptr_offset ( from_offset, self ) ?;
385385
386- // Compute extra and new layout
386+ // Compute meta and new layout
387387 let inner_len = len - to - from;
388- let ( extra , ty) = match base. layout . ty . sty {
388+ let ( meta , ty) = match base. layout . ty . sty {
389389 // It is not nice to match on the type, but that seems to be the only way to
390390 // implement this.
391391 ty:: Array ( inner, _) =>
400400 let layout = self . layout_of ( ty) ?;
401401
402402 Ok ( MPlaceTy {
403- mplace : MemPlace { ptr, align : base. align , extra } ,
403+ mplace : MemPlace { ptr, align : base. align , meta } ,
404404 layout
405405 } )
406406 }
411411 variant : usize ,
412412 ) -> EvalResult < ' tcx , MPlaceTy < ' tcx , M :: PointerTag > > {
413413 // Downcasts only change the layout
414- assert ! ( base. extra . is_none( ) ) ;
414+ assert ! ( base. meta . is_none( ) ) ;
415415 Ok ( MPlaceTy { layout : base. layout . for_variant ( self , variant) , ..base } )
416416 }
417417
838838 }
839839
840840 let mplace = MPlaceTy {
841- mplace : MemPlace { extra : None , ..* mplace } ,
841+ mplace : MemPlace { meta : None , ..* mplace } ,
842842 layout
843843 } ;
844844 Ok ( ( instance, mplace) )
0 commit comments