diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2025-07-28 18:35:23 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2025-07-30 00:34:26 +0200 |
| commit | 642bec7617b8ad2cb1d3a036991e130166c4ffaf (patch) | |
| tree | 6bde7f79846ca960eaab18b06974b3b2faf80240 /tests/rustdoc-js-std/parser-errors.js | |
| parent | c7dd98c80913b9845f49997142e5bec3524bc343 (diff) | |
| download | rust-642bec7617b8ad2cb1d3a036991e130166c4ffaf.tar.gz rust-642bec7617b8ad2cb1d3a036991e130166c4ffaf.zip | |
Optimize some usages of double unary operators in suggestions
When an expression is made of a `!` or `-` unary operator which does not change the type of the expression, use a new variant in `Sugg` to denote it. This allows replacing an extra application of the same operator by the removal of the original operator instead. Also, when adding a unary operator to a suggestion, do not enclose the operator argument in parentheses if it starts with a unary operator itself unless it is a binary operation (including `as`), because in this case parentheses are required to not bind the lhs only. Some suggestions will now be shown as `x` instead of `!!x`. Right now, no suggestion seems to produce `--x`.
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions
