Skip to content

Commit 9034b87

Browse files
committed
Move in_macro check
1 parent a828692 commit 9034b87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_lints/src/redundant_clone.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
9999
for (bb, bbdata) in mir.basic_blocks().iter_enumerated() {
100100
let terminator = bbdata.terminator();
101101

102+
if in_macro(terminator.source_info.span) {
103+
continue;
104+
}
105+
102106
// Give up on loops
103107
if terminator.successors().any(|s| *s == bb) {
104108
continue;
@@ -174,7 +178,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
174178
};
175179

176180
if_chain! {
177-
if !in_macro(span);
178181
if let Some(snip) = snippet_opt(cx, span);
179182
if let Some(dot) = snip.rfind('.');
180183
then {

0 commit comments

Comments
 (0)