]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/async_yields_async.rs
Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyup
[rust.git] / src / tools / clippy / clippy_lints / src / async_yields_async.rs
index 0619490e73c4361da3284406b0b8bdceff50a128..27c2896e1e5cee71bfc27e48d7ecee0aff5edda5 100644 (file)
@@ -1,4 +1,4 @@
-use clippy_utils::diagnostics::span_lint_and_then;
+use clippy_utils::diagnostics::span_lint_hir_and_then;
 use clippy_utils::source::snippet;
 use clippy_utils::ty::implements_trait;
 use rustc_errors::Applicability;
@@ -24,6 +24,7 @@
     ///   };
     /// }
     /// ```
+    ///
     /// Use instead:
     /// ```rust
     /// async fn foo() {}
@@ -63,9 +64,10 @@ fn check_body(&mut self, cx: &LateContext<'tcx>, body: &'tcx Body<'_>) {
                         _ => None,
                     };
                     if let Some(return_expr_span) = return_expr_span {
-                        span_lint_and_then(
+                        span_lint_hir_and_then(
                             cx,
                             ASYNC_YIELDS_ASYNC,
+                            body.value.hir_id,
                             return_expr_span,
                             "an async construct yields a type which is itself awaitable",
                             |db| {