Stronger macro check
This commit is contained in:
parent
f27cfdb51a
commit
a21108a296
@ -80,7 +80,7 @@ impl LateLintPass for BlockInIfCondition {
|
|||||||
if let Some(ref ex) = block.expr {
|
if let Some(ref ex) = block.expr {
|
||||||
// don't dig into the expression here, just suggest that they remove
|
// don't dig into the expression here, just suggest that they remove
|
||||||
// the block
|
// the block
|
||||||
if differing_macro_contexts(expr.span, ex.span) {
|
if in_macro(cx, expr.span) || differing_macro_contexts(expr.span, ex.span) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
span_help_and_lint(cx,
|
span_help_and_lint(cx,
|
||||||
@ -92,7 +92,7 @@ impl LateLintPass for BlockInIfCondition {
|
|||||||
snippet_block(cx, then.span, "..")));
|
snippet_block(cx, then.span, "..")));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if differing_macro_contexts(expr.span, block.stmts[0].span) {
|
if in_macro(cx, expr.span) || differing_macro_contexts(expr.span, block.stmts[0].span) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// move block higher
|
// move block higher
|
||||||
|
Loading…
x
Reference in New Issue
Block a user