@@ -2,7 +2,7 @@ use crate::utils::{get_trait_def_id, implements_trait, is_entrypoint_fn, match_t
22use if_chain:: if_chain;
33use itertools:: Itertools ;
44use rustc:: lint:: in_external_macro;
5- use rustc:: ty:: TyKind ;
5+ use rustc:: ty;
66use rustc_data_structures:: fx:: FxHashSet ;
77use rustc_hir as hir;
88use 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