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
+2 -2
View File
@@ -237,10 +237,10 @@ fn find_first_write_incompaible(&self, granting: usize) -> usize {
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.