Skip to content

Commit 8210cc1

Browse files
calebcartwrighttopecongiro
authored andcommitted
fix: handle lhs unary in range expression (rust-lang#3855)
1 parent 396a2af commit 8210cc1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/expr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ pub(crate) fn format_expr(
257257
}
258258
_ => false,
259259
},
260+
ast::ExprKind::Unary(_, ref expr) => needs_space_before_range(context, &expr),
260261
_ => false,
261262
}
262263
}

tests/target/issue_3854.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("{:?}", -1. ..1.);
3+
}

0 commit comments

Comments
 (0)