@@ -2,7 +2,7 @@ use crate::utils::{get_trait_def_id, implements_trait, is_entrypoint_fn, match_t
2
2
use if_chain:: if_chain;
3
3
use itertools:: Itertools ;
4
4
use rustc:: lint:: in_external_macro;
5
- use rustc:: ty:: TyKind ;
5
+ use rustc:: ty;
6
6
use rustc_data_structures:: fx:: FxHashSet ;
7
7
use rustc_hir as hir;
8
8
use rustc_lint:: { LateContext , LateLintPass } ;
@@ -225,17 +225,16 @@ fn lint_for_missing_headers<'a, 'tcx>(
225
225
"docs for function returning `Result` missing `# Errors` section" ,
226
226
) ;
227
227
} else {
228
- use TyKind :: * ;
229
228
if_chain ! {
230
229
if let Some ( body_id) = body_id;
231
230
if let Some ( future) = get_trait_def_id( cx, & paths:: FUTURE ) ;
232
231
let def_id = cx. tcx. hir( ) . body_owner_def_id( body_id) ;
233
232
let mir = cx. tcx. optimized_mir( def_id) ;
234
233
let ret_ty = mir. return_ty( ) ;
235
234
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;
239
238
if match_type( cx, subs. as_generator( ) . return_ty( def_id, cx. tcx) , & paths:: RESULT ) ;
240
239
then {
241
240
span_lint(
0 commit comments