Fix unused_async FP for stubs with args (#16832)

Closes rust-lang/rust-clippy#16825

changelog: [`unused_async`] fix FP for stubs with args
This commit is contained in:
dswij
2026-04-12 10:26:20 +00:00
committed by GitHub
2 changed files with 11 additions and 1 deletions
-1
View File
@@ -211,7 +211,6 @@ fn async_fn_contains_todo_unimplemented_macro(cx: &LateContext<'_>, body: &Body<
&& let ClosureKind::Coroutine(CoroutineKind::Desugared(CoroutineDesugaring::Async, _)) = closure.kind
&& let body = cx.tcx.hir_body(closure.body)
&& let ExprKind::Block(block, _) = body.value.kind
&& block.stmts.is_empty()
&& let Some(expr) = block.expr
&& let ExprKind::DropTemps(inner) = expr.kind
{
+11
View File
@@ -134,3 +134,14 @@ async fn unimplemented_task() -> Result<(), String> {
unimplemented!("Implement task");
}
}
mod issue16835 {
async fn todo_task(_arg: i32) {
todo!()
}
async fn unimplemented_task(_arg: i32) {
let a = 1;
unimplemented!()
}
}