let_and_return FP on ugly async Send workaround #8598
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
let_and_return
trips up on an awful construction I invented to avoid a future-not-Send
problem.The workaround code I have here is terrible, but I'm not aware of a better way to write it. (NB that in this example I use
mpc::channel::Receiver
as a thing that isSend
but notSync
; the example program doesn't make much sense semantically.)I bet the underlying cause is the same as #8114.
Lint Name
let_and_return
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
Well, ideally, Rust would have accepted
but failing that, it wouldl be nice if clippy didn't suggest changes that cause compiler errors.
Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: