@@ -276,7 +276,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
276276 kind : MemoryKind < M :: MemoryKind > ,
277277 ) -> InterpResult < ' tcx > {
278278 let ( alloc_id, offset, tag) = self . ptr_get_alloc_id ( ptr) ?;
279- trace ! ( "deallocating: {}" , alloc_id ) ;
279+ trace ! ( "deallocating: {alloc_id:?}" ) ;
280280
281281 if offset. bytes ( ) != 0 {
282282 throw_ub_format ! (
@@ -289,10 +289,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
289289 // Deallocating global memory -- always an error
290290 return Err ( match self . tcx . get_global_alloc ( alloc_id) {
291291 Some ( GlobalAlloc :: Function ( ..) ) => {
292- err_ub_format ! ( "deallocating {}, which is a function" , alloc_id )
292+ err_ub_format ! ( "deallocating {alloc_id:? }, which is a function" )
293293 }
294294 Some ( GlobalAlloc :: Static ( ..) | GlobalAlloc :: Memory ( ..) ) => {
295- err_ub_format ! ( "deallocating {}, which is static memory" , alloc_id )
295+ err_ub_format ! ( "deallocating {alloc_id:? }, which is static memory" )
296296 }
297297 None => err_ub ! ( PointerUseAfterFree ( alloc_id) ) ,
298298 }
@@ -302,21 +302,19 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
302302 debug ! ( ?alloc) ;
303303
304304 if alloc. mutability == Mutability :: Not {
305- throw_ub_format ! ( "deallocating immutable allocation {}" , alloc_id ) ;
305+ throw_ub_format ! ( "deallocating immutable allocation {alloc_id:?}" ) ;
306306 }
307307 if alloc_kind != kind {
308308 throw_ub_format ! (
309- "deallocating {}, which is {} memory, using {} deallocation operation" ,
310- alloc_id,
309+ "deallocating {alloc_id:?}, which is {} memory, using {} deallocation operation" ,
311310 alloc_kind,
312311 kind
313312 ) ;
314313 }
315314 if let Some ( ( size, align) ) = old_size_and_align {
316315 if size != alloc. size ( ) || align != alloc. align {
317316 throw_ub_format ! (
318- "incorrect layout on deallocation: {} has size {} and alignment {}, but gave size {} and alignment {}" ,
319- alloc_id,
317+ "incorrect layout on deallocation: {alloc_id:?} has size {} and alignment {}, but gave size {} and alignment {}" ,
320318 alloc. size( ) . bytes( ) ,
321319 alloc. align. bytes( ) ,
322320 size. bytes( ) ,
@@ -815,7 +813,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> std::fmt::Debug for DumpAllocs<'a,
815813 continue ;
816814 }
817815
818- write ! ( fmt, "{}" , id ) ?;
816+ write ! ( fmt, "{id:?}" ) ?;
819817 match self . ecx . memory . alloc_map . get ( id) {
820818 Some ( & ( kind, ref alloc) ) => {
821819 // normal alloc
@@ -865,13 +863,7 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRefMut<'a, 'tcx, Tag, Extra> {
865863 val : ScalarMaybeUninit < Tag > ,
866864 ) -> InterpResult < ' tcx > {
867865 let range = self . range . subrange ( range) ;
868- debug ! (
869- "write_scalar in {} at {:#x}, size {}: {:?}" ,
870- self . alloc_id,
871- range. start. bytes( ) ,
872- range. size. bytes( ) ,
873- val
874- ) ;
866+ debug ! ( "write_scalar at {:?}{range:?}: {val:?}" , self . alloc_id) ;
875867 Ok ( self
876868 . alloc
877869 . write_scalar ( & self . tcx , range, val)
@@ -906,13 +898,7 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRef<'a, 'tcx, Tag, Extra> {
906898 . alloc
907899 . read_scalar ( & self . tcx , range, read_provenance)
908900 . map_err ( |e| e. to_interp_error ( self . alloc_id ) ) ?;
909- debug ! (
910- "read_scalar in {} at {:#x}, size {}: {:?}" ,
911- self . alloc_id,
912- range. start. bytes( ) ,
913- range. size. bytes( ) ,
914- res
915- ) ;
901+ debug ! ( "read_scalar at {:?}{range:?}: {res:?}" , self . alloc_id) ;
916902 Ok ( res)
917903 }
918904
0 commit comments