diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2021-03-05 10:32:15 -0600 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2021-03-05 10:36:20 -0600 |
| commit | ae8ec07d2e4a4b97168bc02e9bbebb50dd695c1e (patch) | |
| tree | 643adc5637021406751bc0602cdd0df0d654415f | |
| parent | 45454f073894d9e211d086d0c5a0c91fa54f67a9 (diff) | |
| download | rust-ae8ec07d2e4a4b97168bc02e9bbebb50dd695c1e.tar.gz rust-ae8ec07d2e4a4b97168bc02e9bbebb50dd695c1e.zip | |
Avoid mir in missing_errors_doc
| -rw-r--r-- | clippy_lints/src/doc.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index 39a202f281c..99c084af1b0 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -325,9 +325,9 @@ fn lint_for_missing_headers<'tcx>( if_chain! { if let Some(body_id) = body_id; if let Some(future) = cx.tcx.lang_items().future_trait(); - let def_id = cx.tcx.hir().body_owner_def_id(body_id); - let mir = cx.tcx.optimized_mir(def_id.to_def_id()); - 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); if implements_trait(cx, ret_ty, future, &[]); if let ty::Opaque(_, subs) = ret_ty.kind(); if let Some(gen) = subs.types().next(); |
