]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/borrow_check/error_reporting.rs
Add "Shallow" borrow kind
[rust.git] / src / librustc_mir / borrow_check / error_reporting.rs
index 1d91fa365d547a57b565a1d7e4d6760e98f884d6..f0dd8a9feb8e1398adba186a27d6e40f2c733755 100644 (file)
@@ -333,6 +333,11 @@ pub(super) fn report_conflicting_borrow(
                     Origin::Mir,
                 ),
 
+            (BorrowKind::Mut { .. }, _, _, BorrowKind::Shallow, _, _)
+            | (BorrowKind::Unique, _, _, BorrowKind::Shallow, _, _) => {
+                return;
+            }
+
             (BorrowKind::Unique, _, _, _, _, _) => tcx.cannot_uniquely_borrow_by_one_closure(
                 span,
                 &desc_place,