Skip to content

Commit 05ae391

Browse files
committed
1 parent 88564b7 commit 05ae391

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
@@ -156,6 +156,11 @@ fn check_else(cx: &EarlyContext<'_>, expr: &ast::Expr) {
156156
&& !differing_macro_contexts(then.span, else_.span)
157157
&& !in_macro(then.span)
158158
{
159+
// workaround for rust-lang/rust#43081
160+
if expr.span.lo().0 == 0 && expr.span.hi().0 == 0 {
161+
return;
162+
}
163+
159164
// this will be a span from the closing ‘}’ of the “then” block (excluding) to
160165
// the
161166
// “if” of the “else if” block (excluding)

0 commit comments

Comments
 (0)