Merge pull request #726 from RalfJung/stacked-borrows-2

rename per-location aprt of reborowing to 'granting'
This commit is contained in:
Oliver Scherer 2019-05-13 10:48:08 +02:00 committed by GitHub
commit 260256923e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,10 +373,10 @@ impl<'tcx> Stack {
}
/// Derived a new pointer from one with the given tag.
/// `weak` controls whether this is a weak reborrow: weak reborrows do not act as
/// accesses, and they add the new item directly on top of the one it is derived
/// `weak` controls whether this operation is weak or strong: weak granting does not act as
/// an access, and they add the new item directly on top of the one it is derived
/// from instead of all the way at the top of the stack.
fn reborrow(
fn grant(
&mut self,
derived_from: Tag,
weak: bool,
@ -588,7 +588,7 @@ trait EvalContextPrivExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
let weak = perm == Permission::SharedReadWrite;
let item = Item { perm, tag: new_tag, protector };
alloc.extra.for_each(cur_ptr, size, |stack, global| {
stack.reborrow(cur_ptr.tag, force_weak || weak, item, global)
stack.grant(cur_ptr.tag, force_weak || weak, item, global)
})
});
}
@ -597,7 +597,7 @@ trait EvalContextPrivExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
let weak = perm == Permission::SharedReadWrite;
let item = Item { perm, tag: new_tag, protector };
alloc.extra.for_each(ptr, size, |stack, global| {
stack.reborrow(ptr.tag, force_weak || weak, item, global)
stack.grant(ptr.tag, force_weak || weak, item, global)
})
}