@@ -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:: * ;
@@ -1240,10 +1240,10 @@ impl LintPass for NonSnakeCase {
12401240 }
12411241
12421242 fn check_fn ( & mut self , cx : & Context ,
1243- fk : visit :: FnKind , _: & ast:: FnDecl ,
1243+ fk : FnKind , _: & ast:: FnDecl ,
12441244 _: & ast:: Block , span : Span , id : ast:: NodeId ) {
12451245 match fk {
1246- visit :: FkMethod ( ident, _, _) => match method_context ( cx, id, span) {
1246+ FnKind :: Method ( ident, _, _) => match method_context ( cx, id, span) {
12471247 MethodContext :: PlainImpl => {
12481248 self . check_snake_case ( cx, "method" , & ident. name . as_str ( ) , Some ( span) )
12491249 } ,
@@ -1252,7 +1252,7 @@ impl LintPass for NonSnakeCase {
12521252 } ,
12531253 _ => ( ) ,
12541254 } ,
1255- visit :: FkItemFn ( ident, _, _, _, _, _) => {
1255+ FnKind :: ItemFn ( ident, _, _, _, _, _) => {
12561256 self . check_snake_case ( cx, "function" , & ident. name . as_str ( ) , Some ( span) )
12571257 } ,
12581258 _ => ( ) ,
@@ -1598,13 +1598,13 @@ impl LintPass for UnsafeCode {
15981598 }
15991599 }
16001600
1601- fn check_fn ( & mut self , cx : & Context , fk : visit :: FnKind , _: & ast:: FnDecl ,
1601+ fn check_fn ( & mut self , cx : & Context , fk : FnKind , _: & ast:: FnDecl ,
16021602 _: & ast:: Block , span : Span , _: ast:: NodeId ) {
16031603 match fk {
1604- visit :: FkItemFn ( _, _, ast:: Unsafety :: Unsafe , _, _, _) =>
1604+ FnKind :: ItemFn ( _, _, ast:: Unsafety :: Unsafe , _, _, _) =>
16051605 cx. span_lint ( UNSAFE_CODE , span, "declaration of an `unsafe` function" ) ,
16061606
1607- visit :: FkMethod ( _, sig, _) => {
1607+ FnKind :: Method ( _, sig, _) => {
16081608 if sig. unsafety == ast:: Unsafety :: Unsafe {
16091609 cx. span_lint ( UNSAFE_CODE , span, "implementation of an `unsafe` method" )
16101610 }
@@ -1685,7 +1685,7 @@ impl LintPass for UnusedMut {
16851685 }
16861686
16871687 fn check_fn ( & mut self , cx : & Context ,
1688- _: visit :: FnKind , decl : & ast:: FnDecl ,
1688+ _: FnKind , decl : & ast:: FnDecl ,
16891689 _: & ast:: Block , _: Span , _: ast:: NodeId ) {
16901690 for a in & decl. inputs {
16911691 self . check_unused_mut_pat ( cx, slice:: ref_slice ( & a. pat ) ) ;
@@ -2126,18 +2126,18 @@ impl LintPass for UnconditionalRecursion {
21262126 lint_array ! [ UNCONDITIONAL_RECURSION ]
21272127 }
21282128
2129- fn check_fn ( & mut self , cx : & Context , fn_kind : visit :: FnKind , _: & ast:: FnDecl ,
2129+ fn check_fn ( & mut self , cx : & Context , fn_kind : FnKind , _: & ast:: FnDecl ,
21302130 blk : & ast:: Block , sp : Span , id : ast:: NodeId ) {
21312131 type F = for <' tcx > fn ( & ty:: ctxt < ' tcx > ,
21322132 ast:: NodeId , ast:: NodeId , ast:: Ident , ast:: NodeId ) -> bool ;
21332133
21342134 let method = match fn_kind {
2135- visit :: FkItemFn ( ..) => None ,
2136- visit :: FkMethod ( ..) => {
2135+ FnKind :: ItemFn ( ..) => None ,
2136+ FnKind :: Method ( ..) => {
21372137 cx. tcx . impl_or_trait_item ( DefId :: local ( id) ) . as_opt_method ( )
21382138 }
21392139 // closures can't recur, so they don't matter.
2140- visit :: FkClosure => return
2140+ FnKind :: Closure => return
21412141 } ;
21422142
21432143 // Walk through this function (say `f`) looking to see if
0 commit comments