Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let_and_return shouldn't trigger if the let has an attribute #3882

Closed
Ravenslofty opened this issue Mar 14, 2019 · 1 comment · Fixed by #4024
Closed

let_and_return shouldn't trigger if the let has an attribute #3882

Ravenslofty opened this issue Mar 14, 2019 · 1 comment · Fixed by #4024
Labels
C-bug Category: Clippy is not doing the correct thing good-first-issue These issues are a good way to get started with Clippy I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied L-suggestion Lint: Improving, adding or fixing lint suggestions

Comments

@Ravenslofty
Copy link

Ravenslofty commented Mar 14, 2019

This is possibly a generalisation of #1346.

This minimal example shows let_and_return triggering for a statement which has a #[allow()] attribute. Following the clippy suggestion hits rust-lang/rust#15701, which is feature-gated. Worth noting is that braces can be used to work around this, which could be used as a suggestion in this case.

@flip1995 flip1995 added C-bug Category: Clippy is not doing the correct thing L-suggestion Lint: Improving, adding or fixing lint suggestions I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied good-first-issue These issues are a good way to get started with Clippy labels Mar 14, 2019
@Ravenslofty
Copy link
Author

(I corrected the braces playground link to actually use braces).

kraai added a commit to kraai/rust-clippy that referenced this issue Apr 24, 2019
bors added a commit that referenced this issue Apr 24, 2019
…utes, r=flip1995

Suppress let_and_return if let has attributes

Fixes #3882.

changelog: suppress `let_and_return` if `let` has attributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing good-first-issue These issues are a good way to get started with Clippy I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied L-suggestion Lint: Improving, adding or fixing lint suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants