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

nits
This commit is contained in:
Oliver Scherer 2019-05-17 23:57:34 +02:00 committed by GitHub
commit 37b2eea714
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,10 +237,10 @@ impl<'tcx> Stack {
bug!("Cannot use Disabled for anything"),
Permission::Unique =>
// On a write, everything above us is incompatible.
granting+1,
granting + 1,
Permission::SharedReadWrite => {
// The SharedReadWrite *just* above us are compatible, to skip those.
let mut idx = granting+1;
let mut idx = granting + 1;
while let Some(item) = self.borrows.get(idx) {
if item.perm == Permission::SharedReadWrite {
// Go on.