@@ -18,8 +18,8 @@ use rustc_ast::AttrStyle;
18
18
use rustc_hir:: intravisit:: FnKind ;
19
19
use rustc_hir:: {
20
20
Block , BlockCheckMode , Body , Closure , Destination , Expr , ExprKind , FieldDef , FnHeader , FnRetTy , HirId , Impl ,
21
- ImplItem , ImplItemKind , IsAuto , Item , ItemKind , LoopSource , MatchSource , MutTy , Node , QPath , TraitItem ,
22
- TraitItemKind , Ty , TyKind , UnOp , UnsafeSource , Unsafety , Variant , VariantData , YieldSource ,
21
+ ImplItem , ImplItemKind , IsAuto , Item , ItemKind , LoopSource , MatchSource , MutTy , Node , QPath , Safety , TraitItem ,
22
+ TraitItemKind , Ty , TyKind , UnOp , UnsafeSource , Variant , VariantData , YieldSource ,
23
23
} ;
24
24
use rustc_lint:: { LateContext , LintContext } ;
25
25
use rustc_middle:: ty:: TyCtxt ;
@@ -207,10 +207,9 @@ fn item_search_pat(item: &Item<'_>) -> (Pat, Pat) {
207
207
ItemKind :: Struct ( VariantData :: Struct { .. } , _) => ( Pat :: Str ( "struct" ) , Pat :: Str ( "}" ) ) ,
208
208
ItemKind :: Struct ( ..) => ( Pat :: Str ( "struct" ) , Pat :: Str ( ";" ) ) ,
209
209
ItemKind :: Union ( ..) => ( Pat :: Str ( "union" ) , Pat :: Str ( "}" ) ) ,
210
- ItemKind :: Trait ( _, Unsafety :: Unsafe , ..)
210
+ ItemKind :: Trait ( _, Safety :: Unsafe , ..)
211
211
| ItemKind :: Impl ( Impl {
212
- unsafety : Unsafety :: Unsafe ,
213
- ..
212
+ safety : Safety :: Unsafe , ..
214
213
} ) => ( Pat :: Str ( "unsafe" ) , Pat :: Str ( "}" ) ) ,
215
214
ItemKind :: Trait ( IsAuto :: Yes , ..) => ( Pat :: Str ( "auto" ) , Pat :: Str ( "}" ) ) ,
216
215
ItemKind :: Trait ( ..) => ( Pat :: Str ( "trait" ) , Pat :: Str ( "}" ) ) ,
@@ -323,7 +322,7 @@ fn ty_search_pat(ty: &Ty<'_>) -> (Pat, Pat) {
323
322
TyKind :: Ptr ( MutTy { ty, .. } ) => ( Pat :: Str ( "*" ) , ty_search_pat ( ty) . 1 ) ,
324
323
TyKind :: Ref ( _, MutTy { ty, .. } ) => ( Pat :: Str ( "&" ) , ty_search_pat ( ty) . 1 ) ,
325
324
TyKind :: BareFn ( bare_fn) => (
326
- if bare_fn. unsafety == Unsafety :: Unsafe {
325
+ if bare_fn. safety == Safety :: Unsafe {
327
326
Pat :: Str ( "unsafe" )
328
327
} else if bare_fn. abi != Abi :: Rust {
329
328
Pat :: Str ( "extern" )
0 commit comments