@@ -12,7 +12,7 @@ use std::borrow::Cow;
12
12
use syntax:: ast:: { FloatTy , IntTy , UintTy } ;
13
13
use syntax:: codemap:: Span ;
14
14
use syntax:: errors:: DiagnosticBuilder ;
15
- use utils:: { comparisons, higher, in_constant, in_external_macro, in_macro, last_path_segment, match_def_path, match_path,
15
+ use utils:: { comparisons, differing_macro_contexts , higher, in_constant, in_external_macro, in_macro, last_path_segment, match_def_path, match_path,
16
16
match_type, multispan_sugg, opt_def_id, same_tys, snippet, snippet_opt, span_help_and_lint, span_lint,
17
17
span_lint_and_sugg, span_lint_and_then, clip, unsext, sext, int_bits} ;
18
18
use utils:: paths;
@@ -1714,6 +1714,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitHasher {
1714
1714
vis. visit_ty ( ty) ;
1715
1715
1716
1716
for target in & vis. found {
1717
+ if differing_macro_contexts ( item. span , target. span ( ) ) {
1718
+ return ;
1719
+ }
1720
+
1717
1721
let generics_suggestion_span = generics. span . substitute_dummy ( {
1718
1722
let pos = snippet_opt ( cx, item. span . until ( target. span ( ) ) )
1719
1723
. and_then ( |snip| Some ( item. span . lo ( ) + BytePos ( snip. find ( "impl" ) ? as u32 + 4 ) ) )
0 commit comments