Skip to content

Commit ae8ec07

Browse files
committed
Avoid mir in missing_errors_doc
1 parent 45454f0 commit ae8ec07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/doc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ fn lint_for_missing_headers<'tcx>(
325325
if_chain! {
326326
if let Some(body_id) = body_id;
327327
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();
328+
let typeck = cx.tcx.typeck_body(body_id);
329+
let body = cx.tcx.hir().body(body_id);
330+
let ret_ty = typeck.expr_ty(&body.value);
331331
if implements_trait(cx, ret_ty, future, &[]);
332332
if let ty::Opaque(_, subs) = ret_ty.kind();
333333
if let Some(gen) = subs.types().next();

0 commit comments

Comments
 (0)