mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
Use typeck_body
This commit is contained in:
parent
ae8ec07d2e
commit
5abd8c5995
2 changed files with 2 additions and 4 deletions
|
@ -50,8 +50,7 @@ impl<'tcx> LateLintPass<'tcx> for AsyncYieldsAsync {
|
||||||
let body_id = BodyId {
|
let body_id = BodyId {
|
||||||
hir_id: body.value.hir_id,
|
hir_id: body.value.hir_id,
|
||||||
};
|
};
|
||||||
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
|
let typeck_results = cx.tcx.typeck_body(body_id);
|
||||||
let typeck_results = cx.tcx.typeck(def_id);
|
|
||||||
let expr_ty = typeck_results.expr_ty(&body.value);
|
let expr_ty = typeck_results.expr_ty(&body.value);
|
||||||
|
|
||||||
if implements_trait(cx, expr_ty, future_trait_def_id, &[]) {
|
if implements_trait(cx, expr_ty, future_trait_def_id, &[]) {
|
||||||
|
|
|
@ -97,8 +97,7 @@ impl LateLintPass<'_> for AwaitHolding {
|
||||||
let body_id = BodyId {
|
let body_id = BodyId {
|
||||||
hir_id: body.value.hir_id,
|
hir_id: body.value.hir_id,
|
||||||
};
|
};
|
||||||
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
|
let typeck_results = cx.tcx.typeck_body(body_id);
|
||||||
let typeck_results = cx.tcx.typeck(def_id);
|
|
||||||
check_interior_types(
|
check_interior_types(
|
||||||
cx,
|
cx,
|
||||||
&typeck_results.generator_interior_types.as_ref().skip_binder(),
|
&typeck_results.generator_interior_types.as_ref().skip_binder(),
|
||||||
|
|
Loading…
Reference in a new issue