@@ -4,6 +4,7 @@ use rustc::ty;
4
4
use rustc:: lint:: * ;
5
5
use std:: collections:: HashSet ;
6
6
use syntax:: ast;
7
+ use syntax:: abi:: Abi ;
7
8
use syntax:: codemap:: Span ;
8
9
use utils:: { span_lint, type_is_unsafe_function} ;
9
10
@@ -85,15 +86,23 @@ impl LateLintPass for Functions {
85
86
86
87
// don't warn for implementations, it's not their fault
87
88
if !is_impl {
88
- self . check_arg_number ( cx, decl, span) ;
89
+ // don't lint extern functions decls, it's not their fault either
90
+ match kind {
91
+ hir:: intravisit:: FnKind :: Method ( _, & hir:: MethodSig { abi : Abi :: Rust , .. } , _, _) |
92
+ hir:: intravisit:: FnKind :: ItemFn ( _, _, _, _, Abi :: Rust , _, _) => self . check_arg_number ( cx, decl, span) ,
93
+ _ => { } ,
94
+ }
89
95
}
90
96
91
97
self . check_raw_ptr ( cx, unsafety, decl, block, nodeid) ;
92
98
}
93
99
94
100
fn check_trait_item ( & mut self , cx : & LateContext , item : & hir:: TraitItem ) {
95
101
if let hir:: MethodTraitItem ( ref sig, ref block) = item. node {
96
- self . check_arg_number ( cx, & sig. decl , item. span ) ;
102
+ // don't lint extern functions decls, it's not their fault
103
+ if sig. abi == Abi :: Rust {
104
+ self . check_arg_number ( cx, & sig. decl , item. span ) ;
105
+ }
97
106
98
107
if let Some ( ref block) = * block {
99
108
self . check_raw_ptr ( cx, sig. unsafety , & sig. decl , block, item. id ) ;
0 commit comments