Some more let_and_return
funny-business
#11335
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
Summary
Dearest clippyists!
This is maybe one-and-a-half reports on
clippy::let_and_return
.The first part involves missing parentheses (the clippy fix doesn't add them but they are given as a subsequent fix in the compiler error).
The second-ish is found in the same code whereby the
as _
cast that clippy added as part of the fix can actually be removed for brevity, along with the parentheses that weren't there, so to speak...Reproducer
I tried this code:
in
lib.rs
withcargo clippy --fix
I saw this happen:
(the changed code)
(the error message)
I expected to see this happen:
In a way, as above, but with parentheses around the match blocks (as suggested) so that the code compiles...
You'll note that the
as _
cast that was added along the way by clippy can also be removed.Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: