Skip to content

Commit

Permalink
fix: handle lhs unary in range expression (rust-lang#3855)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright authored and topecongiro committed Oct 11, 2019
1 parent 396a2af commit 8210cc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ pub(crate) fn format_expr(
}
_ => false,
},
ast::ExprKind::Unary(_, ref expr) => needs_space_before_range(context, &expr),
_ => false,
}
}
Expand Down
3 changes: 3 additions & 0 deletions tests/target/issue_3854.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("{:?}", -1. ..1.);
}

0 comments on commit 8210cc1

Please sign in to comment.