Use typeck_body
This commit is contained in:
parent
ae8ec07d2e
commit
5abd8c5995
@ -50,8 +50,7 @@ impl<'tcx> LateLintPass<'tcx> for AsyncYieldsAsync {
|
||||
let body_id = BodyId {
|
||||
hir_id: body.value.hir_id,
|
||||
};
|
||||
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
|
||||
let typeck_results = cx.tcx.typeck(def_id);
|
||||
let typeck_results = cx.tcx.typeck_body(body_id);
|
||||
let expr_ty = typeck_results.expr_ty(&body.value);
|
||||
|
||||
if implements_trait(cx, expr_ty, future_trait_def_id, &[]) {
|
||||
|
@ -97,8 +97,7 @@ impl LateLintPass<'_> for AwaitHolding {
|
||||
let body_id = BodyId {
|
||||
hir_id: body.value.hir_id,
|
||||
};
|
||||
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
|
||||
let typeck_results = cx.tcx.typeck(def_id);
|
||||
let typeck_results = cx.tcx.typeck_body(body_id);
|
||||
check_interior_types(
|
||||
cx,
|
||||
&typeck_results.generator_interior_types.as_ref().skip_binder(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user