@@ -18,9 +18,9 @@ use std::collections::Bound;
18
18
use crate :: syntax:: ast:: LitKind ;
19
19
use crate :: syntax:: source_map:: Span ;
20
20
use crate :: utils:: paths;
21
- use crate :: utils:: { expr_block, is_allowed, is_expn_of, match_qpath, match_type, multispan_sugg ,
22
- remove_blocks, snippet, span_lint_and_sugg, span_lint_and_then,
23
- span_note_and_lint, walk_ptrs_ty} ;
21
+ use crate :: utils:: { expr_block, in_macro , is_allowed, is_expn_of, match_qpath, match_type,
22
+ multispan_sugg , remove_blocks, snippet, span_lint_and_sugg, span_lint_and_then,
23
+ span_note_and_lint, walk_ptrs_ty} ;
24
24
use crate :: utils:: sugg:: Sugg ;
25
25
use crate :: consts:: { constant, Constant } ;
26
26
use crate :: rustc_errors:: Applicability ;
@@ -457,7 +457,9 @@ fn check_match_ref_pats(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm], expr:
457
457
} ) ) ;
458
458
459
459
span_lint_and_then ( cx, MATCH_REF_PATS , expr. span , title, |db| {
460
- multispan_sugg ( db, msg. to_owned ( ) , suggs) ;
460
+ if !in_macro ( expr. span ) {
461
+ multispan_sugg ( db, msg. to_owned ( ) , suggs) ;
462
+ }
461
463
} ) ;
462
464
}
463
465
}
0 commit comments