Skip to content

Commit 952d216

Browse files
committed
[let_underscore_untyped]: fix false positive on async function
1 parent 5e0afee commit 952d216

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clippy_lints/src/let_underscore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore {
200200
}
201201

202202
// Ignore if it is from a procedural macro...
203-
if is_from_proc_macro(cx, init) {
203+
if is_from_proc_macro(cx, init) || init.span.from_expansion() {
204204
return;
205205
}
206206

tests/ui/let_underscore_untyped.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ fn main() {
7373
#[allow(clippy::let_underscore_untyped)]
7474
let _ = a();
7575
}
76+
77+
async fn dont_lint_async_prototype(_: u8) {}

0 commit comments

Comments
 (0)