Wrong needless_return suggestion with blocks #2472
Labels
C-bug
Category: Clippy is not doing the correct thing
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Clippy suggests changing
return { e } + 10;
to{ x } + 10
instead of({ x }) + 10
or({ x } + 10)
, and that doesn't compile.I'm not sure what it should do, always parenthesise the inner span?
rustfmt
doesn't fix that, and it would be a bit ugly. Should it recurse into the expression to see if there are any blocks?The text was updated successfully, but these errors were encountered: