Fix FP for let_unit_value
when await
used
This commit is contained in:
parent
8b65632b6e
commit
027f19c8b9
@ -5,7 +5,7 @@
|
||||
use core::ops::ControlFlow;
|
||||
use rustc_errors::Applicability;
|
||||
use rustc_hir::def::{DefKind, Res};
|
||||
use rustc_hir::{Expr, ExprKind, HirId, HirIdSet, Local, Node, PatKind, QPath, TyKind};
|
||||
use rustc_hir::{Expr, ExprKind, HirId, HirIdSet, Local, MatchSource, Node, PatKind, QPath, TyKind};
|
||||
use rustc_lint::{LateContext, LintContext};
|
||||
use rustc_middle::lint::in_external_macro;
|
||||
use rustc_middle::ty;
|
||||
@ -41,6 +41,10 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, local: &'tcx Local<'_>) {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if let ExprKind::Match(_, _, MatchSource::AwaitDesugar) = init.kind {
|
||||
return
|
||||
}
|
||||
|
||||
span_lint_and_then(
|
||||
cx,
|
||||
LET_UNIT_VALUE,
|
||||
|
@ -175,3 +175,7 @@ fn attributes() {
|
||||
#[expect(clippy::let_unit_value)]
|
||||
let _ = f();
|
||||
}
|
||||
|
||||
async fn issue10433() {
|
||||
let _pending: () = std::future::pending().await;
|
||||
}
|
||||
|
@ -175,3 +175,7 @@ fn f() {}
|
||||
#[expect(clippy::let_unit_value)]
|
||||
let _ = f();
|
||||
}
|
||||
|
||||
async fn issue10433() {
|
||||
let _pending: () = std::future::pending().await;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user