Skip to content

Commit 5abd8c5

Browse files
committed
Use typeck_body
1 parent ae8ec07 commit 5abd8c5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

clippy_lints/src/async_yields_async.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ impl<'tcx> LateLintPass<'tcx> for AsyncYieldsAsync {
5050
let body_id = BodyId {
5151
hir_id: body.value.hir_id,
5252
};
53-
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
54-
let typeck_results = cx.tcx.typeck(def_id);
53+
let typeck_results = cx.tcx.typeck_body(body_id);
5554
let expr_ty = typeck_results.expr_ty(&body.value);
5655

5756
if implements_trait(cx, expr_ty, future_trait_def_id, &[]) {

clippy_lints/src/await_holding_invalid.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ impl LateLintPass<'_> for AwaitHolding {
9797
let body_id = BodyId {
9898
hir_id: body.value.hir_id,
9999
};
100-
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
101-
let typeck_results = cx.tcx.typeck(def_id);
100+
let typeck_results = cx.tcx.typeck_body(body_id);
102101
check_interior_types(
103102
cx,
104103
&typeck_results.generator_interior_types.as_ref().skip_binder(),

0 commit comments

Comments
 (0)