@@ -51,7 +51,7 @@ use syntax::codemap::{self, Span};
5151use syntax:: feature_gate:: { KNOWN_ATTRIBUTES , AttributeType } ;
5252use syntax:: ast:: { TyIs , TyUs , TyI8 , TyU8 , TyI16 , TyU16 , TyI32 , TyU32 , TyI64 , TyU64 } ;
5353use syntax:: ptr:: P ;
54- use syntax:: visit:: { self , Visitor } ;
54+ use syntax:: visit:: { self , FnKind , Visitor } ;
5555
5656// hardwired lints from librustc
5757pub use lint:: builtin:: * ;
@@ -1242,10 +1242,10 @@ impl LintPass for NonSnakeCase {
12421242 }
12431243
12441244 fn check_fn ( & mut self , cx : & Context ,
1245- fk : visit :: FnKind , _: & ast:: FnDecl ,
1245+ fk : FnKind , _: & ast:: FnDecl ,
12461246 _: & ast:: Block , span : Span , id : ast:: NodeId ) {
12471247 match fk {
1248- visit :: FkMethod ( ident, _, _) => match method_context ( cx, id, span) {
1248+ FnKind :: Method ( ident, _, _) => match method_context ( cx, id, span) {
12491249 MethodContext :: PlainImpl => {
12501250 self . check_snake_case ( cx, "method" , & ident. name . as_str ( ) , Some ( span) )
12511251 } ,
@@ -1254,7 +1254,7 @@ impl LintPass for NonSnakeCase {
12541254 } ,
12551255 _ => ( ) ,
12561256 } ,
1257- visit :: FkItemFn ( ident, _, _, _, _, _) => {
1257+ FnKind :: ItemFn ( ident, _, _, _, _, _) => {
12581258 self . check_snake_case ( cx, "function" , & ident. name . as_str ( ) , Some ( span) )
12591259 } ,
12601260 _ => ( ) ,
@@ -1600,13 +1600,13 @@ impl LintPass for UnsafeCode {
16001600 }
16011601 }
16021602
1603- fn check_fn ( & mut self , cx : & Context , fk : visit :: FnKind , _: & ast:: FnDecl ,
1603+ fn check_fn ( & mut self , cx : & Context , fk : FnKind , _: & ast:: FnDecl ,
16041604 _: & ast:: Block , span : Span , _: ast:: NodeId ) {
16051605 match fk {
1606- visit :: FkItemFn ( _, _, ast:: Unsafety :: Unsafe , _, _, _) =>
1606+ FnKind :: ItemFn ( _, _, ast:: Unsafety :: Unsafe , _, _, _) =>
16071607 cx. span_lint ( UNSAFE_CODE , span, "declaration of an `unsafe` function" ) ,
16081608
1609- visit :: FkMethod ( _, sig, _) => {
1609+ FnKind :: Method ( _, sig, _) => {
16101610 if sig. unsafety == ast:: Unsafety :: Unsafe {
16111611 cx. span_lint ( UNSAFE_CODE , span, "implementation of an `unsafe` method" )
16121612 }
@@ -1687,7 +1687,7 @@ impl LintPass for UnusedMut {
16871687 }
16881688
16891689 fn check_fn ( & mut self , cx : & Context ,
1690- _: visit :: FnKind , decl : & ast:: FnDecl ,
1690+ _: FnKind , decl : & ast:: FnDecl ,
16911691 _: & ast:: Block , _: Span , _: ast:: NodeId ) {
16921692 for a in & decl. inputs {
16931693 self . check_unused_mut_pat ( cx, slice:: ref_slice ( & a. pat ) ) ;
@@ -2128,18 +2128,18 @@ impl LintPass for UnconditionalRecursion {
21282128 lint_array ! [ UNCONDITIONAL_RECURSION ]
21292129 }
21302130
2131- fn check_fn ( & mut self , cx : & Context , fn_kind : visit :: FnKind , _: & ast:: FnDecl ,
2131+ fn check_fn ( & mut self , cx : & Context , fn_kind : FnKind , _: & ast:: FnDecl ,
21322132 blk : & ast:: Block , sp : Span , id : ast:: NodeId ) {
21332133 type F = for <' tcx > fn ( & ty:: ctxt < ' tcx > ,
21342134 ast:: NodeId , ast:: NodeId , ast:: Ident , ast:: NodeId ) -> bool ;
21352135
21362136 let method = match fn_kind {
2137- visit :: FkItemFn ( ..) => None ,
2138- visit :: FkMethod ( ..) => {
2137+ FnKind :: ItemFn ( ..) => None ,
2138+ FnKind :: Method ( ..) => {
21392139 cx. tcx . impl_or_trait_item ( DefId :: local ( id) ) . as_opt_method ( )
21402140 }
21412141 // closures can't recur, so they don't matter.
2142- visit :: FkClosure => return
2142+ FnKind :: Closure => return
21432143 } ;
21442144
21452145 // Walk through this function (say `f`) looking to see if
0 commit comments