let_and_return lint false positive #5729
Labels
C-bug
Category: Clippy is not doing the correct thing
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
I've encountered a false positive with the
let_and_return
lint. Here's a minimum example that demonstrates the issue: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=37bcec97617120eafab94ca5216bf579If you run clippy on it, you get the following output:
If you try to follow its advice, however, and try to return
Arc::clone(&self.foo)
directly, you will instead get this compilation error:The text was updated successfully, but these errors were encountered: