@@ -8,9 +8,9 @@ use syntax::ptr::P;
8
8
use syntax:: codemap:: Span ;
9
9
10
10
use utils:: {
11
- snippet , span_lint , span_note_and_lint , match_path , match_type , method_chain_args ,
12
- match_trait_method, walk_ptrs_ty_depth , walk_ptrs_ty , get_trait_def_id , implements_trait ,
13
- span_lint_and_then
11
+ get_trait_def_id , implements_trait , in_external_macro , in_macro , match_path ,
12
+ match_trait_method, match_type , method_chain_args , snippet , span_lint , span_lint_and_then ,
13
+ span_note_and_lint , walk_ptrs_ty , walk_ptrs_ty_depth ,
14
14
} ;
15
15
use utils:: {
16
16
BTREEMAP_ENTRY_PATH , DEFAULT_TRAIT_PATH , HASHMAP_ENTRY_PATH , OPTION_PATH , RESULT_PATH ,
@@ -231,6 +231,10 @@ impl LintPass for MethodsPass {
231
231
232
232
impl LateLintPass for MethodsPass {
233
233
fn check_expr ( & mut self , cx : & LateContext , expr : & Expr ) {
234
+ if in_macro ( cx, expr. span ) {
235
+ return ;
236
+ }
237
+
234
238
match expr. node {
235
239
ExprMethodCall ( name, _, ref args) => {
236
240
// Chain calls
@@ -266,6 +270,10 @@ impl LateLintPass for MethodsPass {
266
270
}
267
271
268
272
fn check_item ( & mut self , cx : & LateContext , item : & Item ) {
273
+ if in_external_macro ( cx, item. span ) {
274
+ return ;
275
+ }
276
+
269
277
if let ItemImpl ( _, _, _, None , ref ty, ref items) = item. node {
270
278
for implitem in items {
271
279
let name = implitem. name ;
0 commit comments