about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/coverage/enum-tuple.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-26 02:00:26 +0000
committerbors <bors@rust-lang.org>2022-12-26 02:00:26 +0000
commitd98e714988d9beebe416c6e3808e4173d928c5ed (patch)
tree6ffd2bbe86d78d815a03aece3f0d603f824cf18c /src/test/rustdoc-ui/coverage/enum-tuple.rs
parent4f1bae0c96402b874c2f5686032eb3527b4f1900 (diff)
parent6bb6dd64d44eab37fef808ce96d3abb87e5e02b3 (diff)
downloadrust-d98e714988d9beebe416c6e3808e4173d928c5ed.tar.gz
rust-d98e714988d9beebe416c6e3808e4173d928c5ed.zip
Auto merge of #10113 - EricWu2003:suboptimal_flops_incorrect_suggestion, r=Jarcho
fix incorrect suggestion in `suboptimal_flops`

fixes #10003

There was an error when trying to negate an expression like `x - 1.0`. We used to format it as `-x - 1.0` whereas a proper negation would be `-(x - 1.0)`.

Therefore, we add parentheses around the expression when it is `ExprKind::Binary`.

We also add parentheses around multiply and divide expressions, even though this is not strictly necessary.

changelog: [`suboptimal_flops`]: fix incorrect suggestion caused by an incorrect negation of floating point expressions.
Diffstat (limited to 'src/test/rustdoc-ui/coverage/enum-tuple.rs')
0 files changed, 0 insertions, 0 deletions