Move in_macro check

This commit is contained in:
Shotaro Yamada 2018-10-26 03:07:29 +09:00
parent a828692780
commit 9034b87a53

View 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 {