]> git.lizzy.rs Git - rust.git/commitdiff
Move in_macro check
authorShotaro Yamada <sinkuu@sinkuu.xyz>
Thu, 25 Oct 2018 18:07:29 +0000 (03:07 +0900)
committerShotaro Yamada <sinkuu@sinkuu.xyz>
Thu, 25 Oct 2018 18:07:29 +0000 (03:07 +0900)
clippy_lints/src/redundant_clone.rs

index 85f7bbb637ca4f6c256f3f70ec1b999d5f6ed197..8c8959159217c46615a9334187f02c03b9994205 100644 (file)
@@ -99,6 +99,10 @@ fn check_fn(
         for (bb, bbdata) in mir.basic_blocks().iter_enumerated() {
             let terminator = bbdata.terminator();
 
+            if in_macro(terminator.source_info.span) {
+                continue;
+            }
+
             // Give up on loops
             if terminator.successors().any(|s| *s == bb) {
                 continue;
@@ -174,7 +178,6 @@ fn check_fn(
                 };
 
                 if_chain! {
-                    if !in_macro(span);
                     if let Some(snip) = snippet_opt(cx, span);
                     if let Some(dot) = snip.rfind('.');
                     then {