Fix rebase fallout

This commit is contained in:
flip1995 2020-06-07 21:33:03 +02:00
parent ecabed67ec
commit a9ca832b11
No known key found for this signature in database
GPG Key ID: 2CEFCDB27ED0BE79
2 changed files with 8 additions and 12 deletions

View File

@ -54,18 +54,13 @@
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);
}
}
}

View File

@ -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`.