]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/await_holding_invalid.rs
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / clippy_lints / src / await_holding_invalid.rs
index ca819663fded8f172236bf8eaf05aa43953856c1..ae64c688744542512bb804858aa55c873a805066 100644 (file)
@@ -18,7 +18,7 @@
     /// other solution is to ensure the mutex is unlocked before calling await,
     /// either by introducing a scope or an explicit call to Drop::drop.
     ///
-    /// **Known problems:** None.
+    /// **Known problems:** Will report false positive for explicitly dropped guards ([#6446](https://github.com/rust-lang/rust-clippy/issues/6446)).
     ///
     /// **Example:**
     ///
@@ -45,7 +45,7 @@
     /// }
     /// ```
     pub AWAIT_HOLDING_LOCK,
-    correctness,
+    pedantic,
     "Inside an async function, holding a MutexGuard while calling await"
 }
 
@@ -57,7 +57,7 @@
     /// at runtime. Holding onto a `RefCell` ref across an `await` suspension point
     /// risks panics from a mutable ref shared while other refs are outstanding.
     ///
-    /// **Known problems:** None.
+    /// **Known problems:** Will report false positive for explicitly dropped refs ([#6353](https://github.com/rust-lang/rust-clippy/issues/6353)).
     ///
     /// **Example:**
     ///
@@ -84,7 +84,7 @@
     /// }
     /// ```
     pub AWAIT_HOLDING_REFCELL_REF,
-    correctness,
+    pedantic,
     "Inside an async function, holding a RefCell ref while calling await"
 }
 
@@ -99,7 +99,11 @@ fn check_body(&mut self, cx: &LateContext<'_>, body: &'_ Body<'_>) {
             };
             let def_id = cx.tcx.hir().body_owner_def_id(body_id);
             let typeck_results = cx.tcx.typeck(def_id);
-            check_interior_types(cx, &typeck_results.generator_interior_types, body.value.span);
+            check_interior_types(
+                cx,
+                &typeck_results.generator_interior_types.as_ref().skip_binder(),
+                body.value.span,
+            );
         }
     }
 }