Skip to content

Commit a9ca832

Browse files
committed
Fix rebase fallout
1 parent ecabed6 commit a9ca832

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

clippy_lints/src/await_holding_lock.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,13 @@ declare_lint_pass!(AwaitHoldingLock => [AWAIT_HOLDING_LOCK]);
5454
impl LateLintPass<'_, '_> for AwaitHoldingLock {
5555
fn check_body(&mut self, cx: &LateContext<'_, '_>, body: &'_ Body<'_>) {
5656
use AsyncGeneratorKind::{Block, Closure, Fn};
57-
match body.generator_kind {
58-
Some(GeneratorKind::Async(Block))
59-
| Some(GeneratorKind::Async(Closure))
60-
| Some(GeneratorKind::Async(Fn)) => {
61-
let body_id = BodyId {
62-
hir_id: body.value.hir_id,
63-
};
64-
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
65-
let tables = cx.tcx.typeck_tables_of(def_id);
66-
check_interior_types(cx, &tables.generator_interior_types, body.value.span);
67-
},
68-
_ => {},
57+
if let Some(GeneratorKind::Async(Block | Closure | Fn)) = body.generator_kind {
58+
let body_id = BodyId {
59+
hir_id: body.value.hir_id,
60+
};
61+
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
62+
let tables = cx.tcx.typeck_tables_of(def_id);
63+
check_interior_types(cx, &tables.generator_interior_types, body.value.span);
6964
}
7065
}
7166
}

clippy_lints/src/utils/ast_utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use crate::utils::{both, over};
88
use rustc_ast::ast::{self, *};
99
use rustc_ast::ptr::P;
10+
use rustc_span::symbol::Ident;
1011
use std::mem;
1112

1213
/// Checks if each element in the first slice is contained within the latter as per `eq_fn`.

0 commit comments

Comments
 (0)