Closed
Description
While working on #6717, I noticed that sometimes an expression like (1+2)
would be (falsely?) converted to a Sugg::BinOp
, which coupled with the maybe_par
method would produce the suggestion ((1+2))
.
I'm not sure where the issue is: should the expression have been converted into a NonParen
in the first place, or does maybe_par
need to have an additional check when working with BinOp
? If it's the latter, care must be taken because a simple check that the boundaries are ()
is wrong: for example, (1+2) + (3+4)
.
Also related - shouldn't the MaybeParen
branch always return a NonParen
?
It should be noted that this bug affects the following lints:
- floating_point_log
- from_str_radix_10 (WIP)
- manual_memcpy