We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45454f0 commit ae8ec07Copy full SHA for ae8ec07
clippy_lints/src/doc.rs
@@ -325,9 +325,9 @@ fn lint_for_missing_headers<'tcx>(
325
if_chain! {
326
if let Some(body_id) = body_id;
327
if let Some(future) = cx.tcx.lang_items().future_trait();
328
- let def_id = cx.tcx.hir().body_owner_def_id(body_id);
329
- let mir = cx.tcx.optimized_mir(def_id.to_def_id());
330
- let ret_ty = mir.return_ty();
+ let typeck = cx.tcx.typeck_body(body_id);
+ let body = cx.tcx.hir().body(body_id);
+ let ret_ty = typeck.expr_ty(&body.value);
331
if implements_trait(cx, ret_ty, future, &[]);
332
if let ty::Opaque(_, subs) = ret_ty.kind();
333
if let Some(gen) = subs.types().next();
0 commit comments