@@ -25,10 +25,10 @@ use syntax::{abi, ast};
25
25
use syntax:: attr:: { self , AttrMetaMethods } ;
26
26
use syntax:: codemap:: { self , Span } ;
27
27
use syntax:: feature_gate:: { emit_feature_err, GateIssue } ;
28
- use syntax:: ast:: { TyIs , TyUs , TyI8 , TyU8 , TyI16 , TyU16 , TyI32 , TyU32 , TyI64 , TyU64 } ;
28
+ use syntax:: ast:: { NodeId , TyIs , TyUs , TyI8 , TyU8 , TyI16 , TyU16 , TyI32 , TyU32 , TyI64 , TyU64 } ;
29
29
30
30
use rustc_front:: hir;
31
- use rustc_front:: intravisit:: { self , Visitor } ;
31
+ use rustc_front:: intravisit:: { self , FnKind , Visitor } ;
32
32
use rustc_front:: util:: is_shift_binop;
33
33
34
34
declare_lint ! {
@@ -674,4 +674,21 @@ impl LateLintPass for ImproperCTypes {
674
674
}
675
675
}
676
676
}
677
+
678
+ fn check_fn ( & mut self , cx : & LateContext ,
679
+ kind : FnKind ,
680
+ decl : & hir:: FnDecl ,
681
+ _: & hir:: Block ,
682
+ _: Span ,
683
+ _: NodeId ) {
684
+ let abi = match kind {
685
+ FnKind :: ItemFn ( _, _, _, _, abi, _) => abi,
686
+ FnKind :: Method ( _, sig, _) => sig. abi ,
687
+ FnKind :: Closure => return ,
688
+ } ;
689
+
690
+ if should_check_abi ( abi) {
691
+ check_foreign_fn ( cx, decl) ;
692
+ }
693
+ }
677
694
}
0 commit comments