Skip to content

Commit ea5ac40

Browse files
committed
Remove use of TyKind.
1 parent 8e2dab3 commit ea5ac40

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clippy_lints/src/doc.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::utils::{get_trait_def_id, implements_trait, is_entrypoint_fn, match_t
22
use if_chain::if_chain;
33
use itertools::Itertools;
44
use rustc::lint::in_external_macro;
5-
use rustc::ty::TyKind;
5+
use rustc::ty;
66
use rustc_data_structures::fx::FxHashSet;
77
use rustc_hir as hir;
88
use rustc_lint::{LateContext, LateLintPass};
@@ -225,17 +225,16 @@ fn lint_for_missing_headers<'a, 'tcx>(
225225
"docs for function returning `Result` missing `# Errors` section",
226226
);
227227
} else {
228-
use TyKind::*;
229228
if_chain! {
230229
if let Some(body_id) = body_id;
231230
if let Some(future) = get_trait_def_id(cx, &paths::FUTURE);
232231
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
233232
let mir = cx.tcx.optimized_mir(def_id);
234233
let ret_ty = mir.return_ty();
235234
if implements_trait(cx, ret_ty, future, &[]);
236-
if let Opaque(_, subs) = ret_ty.kind;
237-
if let Some(ty) = subs.types().next();
238-
if let Generator(_, subs, _) = ty.kind;
235+
if let ty::Opaque(_, subs) = ret_ty.kind;
236+
if let Some(gen) = subs.types().next();
237+
if let ty::Generator(_, subs, _) = gen.kind;
239238
if match_type(cx, subs.as_generator().return_ty(def_id, cx.tcx), &paths::RESULT);
240239
then {
241240
span_lint(

0 commit comments

Comments
 (0)