]> git.lizzy.rs Git - rust.git/commitdiff
fix typo
authorRalf Jung <post@ralfj.de>
Wed, 30 Oct 2019 14:05:44 +0000 (15:05 +0100)
committerRalf Jung <post@ralfj.de>
Wed, 30 Oct 2019 14:05:44 +0000 (15:05 +0100)
src/stacked_borrows.rs

index 2188b9d5394a310557ba0cb8a2ba67054c04f075..6e63bb073c8c4378a27ac9f2c94fa28971381ce2 100644 (file)
@@ -241,7 +241,7 @@ fn find_granting(&self, access: AccessKind, tag: Tag) -> Option<usize> {
 
     /// Find the first write-incompatible item above the given one --
     /// i.e, find the height to which the stack will be truncated when writing to `granting`.
-    fn find_first_write_incompaible(&self, granting: usize) -> usize {
+    fn find_first_write_incompatible(&self, granting: usize) -> usize {
         let perm = self.borrows[granting].perm;
         match perm {
             Permission::SharedReadOnly =>
@@ -309,7 +309,7 @@ fn access(
         if access == AccessKind::Write {
             // Remove everything above the write-compatible items, like a proper stack. This makes sure read-only and unique
             // pointers become invalid on write accesses (ensures F2a, and ensures U2 for write accesses).
-            let first_incompatible_idx = self.find_first_write_incompaible(granting_idx);
+            let first_incompatible_idx = self.find_first_write_incompatible(granting_idx);
             for item in self.borrows.drain(first_incompatible_idx..).rev() {
                 trace!("access: popping item {:?}", item);
                 Stack::check_protector(&item, Some(tag), global)?;
@@ -391,7 +391,7 @@ fn grant(
             // access.  Instead of popping the stack, we insert the item at the place the stack would
             // be popped to (i.e., we insert it above all the write-compatible items).
             // This ensures F2b by adding the new item below any potentially existing `SharedReadOnly`.
-            self.find_first_write_incompaible(granting_idx)
+            self.find_first_write_incompatible(granting_idx)
         } else {
             // A "safe" reborrow for a pointer that actually expects some aliasing guarantees.
             // Here, creating a reference actually counts as an access.