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

Clippy doesn't honour #![allow(shadow_reuse)] #2745

Closed
darnir opened this issue May 11, 2018 · 2 comments
Closed

Clippy doesn't honour #![allow(shadow_reuse)] #2745

darnir opened this issue May 11, 2018 · 2 comments

Comments

@darnir
Copy link

darnir commented May 11, 2018

I have the shadow_reuse lint explicitly enabled in my crates.

However, in a couple of places, I would like to be able to shadow an existing variable. In such cases, I have an explicit #![allow(shadow_reuse)] right before the statement. However, clippy still emits an error for this case.

Short example: https://play.rust-lang.org/?gist=62855503c6e8760c3a419792ee56440e&version=nightly&mode=debug

@oli-obk
Copy link
Contributor

oli-obk commented May 11, 2018

Side note: #![allow(shadow_reuse)] actually disables the lint. #[allow(shadow_reuse)] doesn't, because the lint works on functions.

Needs a fine grained lint check. Not sure if we can do that in a reasonable way atm.

@brightly-salty
Copy link
Contributor

This seems to me to have been fixed? When I run the playground code, changing shadow_reuse to clippy::shadow_reuse, it compiles without errors.

@oli-obk oli-obk closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants