redundant_closure
false positive with Rc<F>
/Arc<F>
#8073
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Summary
It seems like something changed in 1.57 that causes Clippy to suggest removing a redundant closure involving an
Arc<F>
orRc<F>
, but the suggestion doesn't compile, andrustc
explicitly suggests undoing the suggestion.Lint Name
redundant_closure
Reproducer
I tried this code (playground):
The
redundant_closure
lint suggested rewriting therun
call torun(f2)
:But this suggestion doesn't compile, because
Arc<F>
is not a function. In fact, the compiler tells me to undo what Clippy suggested:This seems to be new behavior in 1.57; the code that triggered this has been around for a while and did not trigger this lint on 1.56. The example code above also does not trigger the lint on 1.56.
Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: