@@ -294,24 +294,6 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
294
294
return interp_ok ( Some ( Provenance :: Concrete { alloc_id, tag : new_tag } ) ) ;
295
295
}
296
296
297
- let span = this. machine . current_span ( ) ;
298
-
299
- // When adding a new node, the SIFA of its parents needs to be updated, potentially across
300
- // the entire memory range. For the parts that are being accessed below, the access itself
301
- // trivially takes care of that. However, we have to do some more work to also deal with the
302
- // parts that are not being accessed. Specifically what we do is that we call
303
- // `update_last_accessed_after_retag` on the SIFA of the permission set for the part of
304
- // memory outside `perm_map` -- so that part is definitely taken care of. The remaining
305
- // concern is the part of memory that is in the range of `perms_map`, but not accessed
306
- // below. There we have two cases:
307
- // * If the type is `!Freeze`, then the non-accessed part uses `nonfreeze_perm`, so the
308
- // `nonfreeze_perm` initialized parts are also fine. We enforce the `freeze_perm` parts to
309
- // be accessed via the assert below, and thus everything is taken care of.
310
- // * If the type is `Freeze`, then `freeze_perm` is used everywhere (both inside and outside
311
- // the initial range), and we update everything to have the `freeze_perm`'s SIFA, so there
312
- // are no issues. (And this assert below is not actually needed in this case).
313
- assert ! ( new_perm. freeze_access) ;
314
-
315
297
let protected = new_perm. protector . is_some ( ) ;
316
298
let precise_interior_mut = this
317
299
. machine
@@ -337,7 +319,7 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
337
319
LocationState :: new_non_accessed ( perm, sifa)
338
320
}
339
321
} ;
340
- let perms_map = if !precise_interior_mut {
322
+ let inside_perms = if !precise_interior_mut {
341
323
// For `!Freeze` types, just pretend the entire thing is an `UnsafeCell`.
342
324
let ty_is_freeze = place. layout . ty . is_freeze ( * this. tcx , this. typing_env ( ) ) ;
343
325
let state = loc_state ( ty_is_freeze) ;
@@ -364,8 +346,8 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
364
346
let alloc_extra = this. get_alloc_extra ( alloc_id) ?;
365
347
let mut tree_borrows = alloc_extra. borrow_tracker_tb ( ) . borrow_mut ( ) ;
366
348
367
- for ( perm_range, perm) in perms_map . iter_all ( ) {
368
- if perm. is_accessed ( ) {
349
+ for ( perm_range, perm) in inside_perms . iter_all ( ) {
350
+ if perm. accessed ( ) {
369
351
// Some reborrows incur a read access to the parent.
370
352
// Adjust range to be relative to allocation start (rather than to `place`).
371
353
let range_in_alloc = AllocRange {
@@ -401,10 +383,10 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
401
383
base_offset,
402
384
orig_tag,
403
385
new_tag,
404
- perms_map ,
386
+ inside_perms ,
405
387
new_perm. outside_perm ,
406
388
protected,
407
- span ,
389
+ this . machine . current_span ( ) ,
408
390
) ?;
409
391
drop ( tree_borrows) ;
410
392
0 commit comments