Skip to content

Commit 2602569

Browse files
authored
Merge pull request #726 from RalfJung/stacked-borrows-2
rename per-location aprt of reborowing to 'granting'
2 parents 72698b1 + a9e6692 commit 2602569

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/stacked_borrows.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ impl<'tcx> Stack {
373373
}
374374

375375
/// Derived a new pointer from one with the given tag.
376-
/// `weak` controls whether this is a weak reborrow: weak reborrows do not act as
377-
/// accesses, and they add the new item directly on top of the one it is derived
376+
/// `weak` controls whether this operation is weak or strong: weak granting does not act as
377+
/// an access, and they add the new item directly on top of the one it is derived
378378
/// from instead of all the way at the top of the stack.
379-
fn reborrow(
379+
fn grant(
380380
&mut self,
381381
derived_from: Tag,
382382
weak: bool,
@@ -588,7 +588,7 @@ trait EvalContextPrivExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
588588
let weak = perm == Permission::SharedReadWrite;
589589
let item = Item { perm, tag: new_tag, protector };
590590
alloc.extra.for_each(cur_ptr, size, |stack, global| {
591-
stack.reborrow(cur_ptr.tag, force_weak || weak, item, global)
591+
stack.grant(cur_ptr.tag, force_weak || weak, item, global)
592592
})
593593
});
594594
}
@@ -597,7 +597,7 @@ trait EvalContextPrivExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
597597
let weak = perm == Permission::SharedReadWrite;
598598
let item = Item { perm, tag: new_tag, protector };
599599
alloc.extra.for_each(ptr, size, |stack, global| {
600-
stack.reborrow(ptr.tag, force_weak || weak, item, global)
600+
stack.grant(ptr.tag, force_weak || weak, item, global)
601601
})
602602
}
603603

0 commit comments

Comments
 (0)