From a9ca832b11f7671f5d88f299a44415cf964304e7 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Sun, 7 Jun 2020 21:33:03 +0200 Subject: [PATCH] Fix rebase fallout --- clippy_lints/src/await_holding_lock.rs | 19 +++++++------------ clippy_lints/src/utils/ast_utils.rs | 1 + 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/clippy_lints/src/await_holding_lock.rs b/clippy_lints/src/await_holding_lock.rs index 832910763e60c..a88f922d8e03d 100644 --- a/clippy_lints/src/await_holding_lock.rs +++ b/clippy_lints/src/await_holding_lock.rs @@ -54,18 +54,13 @@ declare_lint_pass!(AwaitHoldingLock => [AWAIT_HOLDING_LOCK]); impl LateLintPass<'_, '_> for AwaitHoldingLock { fn check_body(&mut self, cx: &LateContext<'_, '_>, body: &'_ Body<'_>) { use AsyncGeneratorKind::{Block, Closure, Fn}; - match body.generator_kind { - Some(GeneratorKind::Async(Block)) - | Some(GeneratorKind::Async(Closure)) - | Some(GeneratorKind::Async(Fn)) => { - let body_id = BodyId { - hir_id: body.value.hir_id, - }; - let def_id = cx.tcx.hir().body_owner_def_id(body_id); - let tables = cx.tcx.typeck_tables_of(def_id); - check_interior_types(cx, &tables.generator_interior_types, body.value.span); - }, - _ => {}, + if let Some(GeneratorKind::Async(Block | Closure | Fn)) = body.generator_kind { + let body_id = BodyId { + hir_id: body.value.hir_id, + }; + let def_id = cx.tcx.hir().body_owner_def_id(body_id); + let tables = cx.tcx.typeck_tables_of(def_id); + check_interior_types(cx, &tables.generator_interior_types, body.value.span); } } } diff --git a/clippy_lints/src/utils/ast_utils.rs b/clippy_lints/src/utils/ast_utils.rs index 69a7b6c051e3b..dcf09da198e2f 100755 --- a/clippy_lints/src/utils/ast_utils.rs +++ b/clippy_lints/src/utils/ast_utils.rs @@ -7,6 +7,7 @@ use crate::utils::{both, over}; use rustc_ast::ast::{self, *}; use rustc_ast::ptr::P; +use rustc_span::symbol::Ident; use std::mem; /// Checks if each element in the first slice is contained within the latter as per `eq_fn`.