@@ -244,7 +244,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
244244 let new_ptr = self . allocate ( new_size, new_align, kind) ;
245245 let old_size = match old_size_and_align {
246246 Some ( ( size, _align) ) => size,
247- None => self . get_raw ( ptr. alloc_id ) ?. size ,
247+ None => self . get_raw ( ptr. alloc_id ) ?. size ( ) ,
248248 } ;
249249 self . copy ( ptr, new_ptr, old_size. min ( new_size) , /*nonoverlapping*/ true ) ?;
250250 self . deallocate ( ptr, old_size_and_align, kind) ?;
@@ -306,11 +306,11 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
306306 ) ;
307307 }
308308 if let Some ( ( size, align) ) = old_size_and_align {
309- if size != alloc. size || align != alloc. align {
309+ if size != alloc. size ( ) || align != alloc. align {
310310 throw_ub_format ! (
311311 "incorrect layout on deallocation: {} has size {} and alignment {}, but gave size {} and alignment {}" ,
312312 ptr. alloc_id,
313- alloc. size. bytes( ) ,
313+ alloc. size( ) . bytes( ) ,
314314 alloc. align. bytes( ) ,
315315 size. bytes( ) ,
316316 align. bytes( ) ,
@@ -319,11 +319,11 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
319319 }
320320
321321 // Let the machine take some extra action
322- let size = alloc. size ;
322+ let size = alloc. size ( ) ;
323323 AllocationExtra :: memory_deallocated ( & mut alloc, ptr, size) ?;
324324
325325 // Don't forget to remember size and align of this now-dead allocation
326- let old = self . dead_alloc_map . insert ( ptr. alloc_id , ( alloc. size , alloc. align ) ) ;
326+ let old = self . dead_alloc_map . insert ( ptr. alloc_id , ( alloc. size ( ) , alloc. align ) ) ;
327327 if old. is_some ( ) {
328328 bug ! ( "Nothing can be deallocated twice" ) ;
329329 }
@@ -586,7 +586,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
586586 // a) cause cycles in case `id` refers to a static
587587 // b) duplicate a global's allocation in miri
588588 if let Some ( ( _, alloc) ) = self . alloc_map . get ( id) {
589- return Ok ( ( alloc. size , alloc. align ) ) ;
589+ return Ok ( ( alloc. size ( ) , alloc. align ) ) ;
590590 }
591591
592592 // # Function pointers
@@ -614,7 +614,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
614614 Some ( GlobalAlloc :: Memory ( alloc) ) => {
615615 // Need to duplicate the logic here, because the global allocations have
616616 // different associated types than the interpreter-local ones.
617- Ok ( ( alloc. size , alloc. align ) )
617+ Ok ( ( alloc. size ( ) , alloc. align ) )
618618 }
619619 Some ( GlobalAlloc :: Function ( _) ) => bug ! ( "We already checked function pointers above" ) ,
620620 // The rest must be dead.
0 commit comments