]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/mir/visit.rs
Add "Shallow" borrow kind
[rust.git] / src / librustc / mir / visit.rs
index 91c83ecb2e23ce308852999cf78ecc891a95dfc1..6de7e2215bf41bb426530d7f522f81871ccba221 100644 (file)
@@ -963,6 +963,7 @@ pub fn is_mutating_use(&self) -> bool {
 
             PlaceContext::Inspect |
             PlaceContext::Borrow { kind: BorrowKind::Shared, .. } |
+            PlaceContext::Borrow { kind: BorrowKind::Shallow, .. } |
             PlaceContext::Borrow { kind: BorrowKind::Unique, .. } |
             PlaceContext::Projection(Mutability::Not) |
             PlaceContext::Copy | PlaceContext::Move |
@@ -974,7 +975,9 @@ pub fn is_mutating_use(&self) -> bool {
     /// Returns true if this place context represents a use that does not change the value.
     pub fn is_nonmutating_use(&self) -> bool {
         match *self {
-            PlaceContext::Inspect | PlaceContext::Borrow { kind: BorrowKind::Shared, .. } |
+            PlaceContext::Inspect |
+            PlaceContext::Borrow { kind: BorrowKind::Shared, .. } |
+            PlaceContext::Borrow { kind: BorrowKind::Shallow, .. } |
             PlaceContext::Borrow { kind: BorrowKind::Unique, .. } |
             PlaceContext::Projection(Mutability::Not) |
             PlaceContext::Copy | PlaceContext::Move => true,