about summary refs log tree commit diff
path: root/clippy_utils/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-14 10:12:58 +0000
committerbors <bors@rust-lang.org>2023-03-14 10:12:58 +0000
commit491f63214ad557f1617d11b05b1e2fb4666bba85 (patch)
treee29913885ad378915caf5add4a3efc3925b1a200 /clippy_utils/src
parentff23e48c30909ea75e71a5755513b55cdbac0ca7 (diff)
parent90afb207eb14e22cc60cea3591509ae568d41c62 (diff)
Auto merge of #104833 - Swatinem:async-identity-future, r=compiler-errors
Remove `identity_future` indirection

This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm.

Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]`annotation.

Fixes https://github.com/rust-lang/rust/issues/104826.
Diffstat (limited to 'clippy_utils/src')
-rw-r--r--clippy_utils/src/lib.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs
index 44b6b9f7b0b..29830557a44 100644
--- a/clippy_utils/src/lib.rs
+++ b/clippy_utils/src/lib.rs
@@ -1904,16 +1904,7 @@ pub fn is_async_fn(kind: FnKind<'_>) -> bool {
 
 /// Peels away all the compiler generated code surrounding the body of an async function,
 pub fn get_async_fn_body<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'_>) -> Option<&'tcx Expr<'tcx>> {
-    if let ExprKind::Call(
-        _,
-        &[
-            Expr {
-                kind: ExprKind::Closure(&Closure { body, .. }),
-                ..
-            },
-        ],
-    ) = body.value.kind
-    {
+    if let ExprKind::Closure(&Closure { body, .. }) = body.value.kind {
         if let ExprKind::Block(
             Block {
                 stmts: [],