Skip to content

Commit faa029f

Browse files
committed
1 parent 89e81b8 commit faa029f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: clippy_lints/src/formatting.rs

+5
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ fn check_else(cx: &EarlyContext<'_>, expr: &ast::Expr) {
157157
if (is_block(else_) || unsugar_if(else_).is_some())
158158
&& !differing_macro_contexts(then.span, else_.span) && !in_macro(then.span)
159159
{
160+
// workaround for rust-lang/rust#43081
161+
if expr.span.lo().0 == 0 && expr.span.hi().0 == 0 {
162+
return;
163+
}
164+
160165
// this will be a span from the closing ‘}’ of the “then” block (excluding) to
161166
// the
162167
// “if” of the “else if” block (excluding)

0 commit comments

Comments
 (0)