about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/coverage/enum-tuple.rs
diff options
context:
space:
mode:
authorEric Wu <eric.dianhao.wu@gmail.com>2022-12-23 16:05:45 -0500
committerEric Wu <eric.dianhao.wu@gmail.com>2022-12-25 16:56:46 -0500
commit6bb6dd64d44eab37fef808ce96d3abb87e5e02b3 (patch)
tree6c01518e014188bed8e68995a47d5054a3a42d1c /src/test/rustdoc-ui/coverage/enum-tuple.rs
parente2a687da72266591354b9c7487044c7809adbf74 (diff)
downloadrust-6bb6dd64d44eab37fef808ce96d3abb87e5e02b3.tar.gz
rust-6bb6dd64d44eab37fef808ce96d3abb87e5e02b3.zip
fix incorrect suggestion in `suboptimal_flops`
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 a
Binary ExprKind.

We also add parentheses around multiply and divide expressions,
even though this is not strictly necessary.
Diffstat (limited to 'src/test/rustdoc-ui/coverage/enum-tuple.rs')
0 files changed, 0 insertions, 0 deletions