]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/build/matches/mod.rs
Add "Shallow" borrow kind
[rust.git] / src / librustc_mir / build / matches / mod.rs
index c30dcdafdb40284ea2470600436e8e86aad92d5d..235440e28417d2f4060a31019e8b563b5d6f6135 100644 (file)
@@ -1363,7 +1363,9 @@ fn bind_matched_candidate_for_guard(
                     // borrow of the whole match input. See additional
                     // discussion on rust-lang/rust#49870.
                     let borrow_kind = match borrow_kind {
-                        BorrowKind::Shared | BorrowKind::Unique => borrow_kind,
+                        BorrowKind::Shared
+                        | BorrowKind::Shallow
+                        | BorrowKind::Unique => borrow_kind,
                         BorrowKind::Mut { .. } => BorrowKind::Mut {
                             allow_two_phase_borrow: true,
                         },