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

#[allow(non_camel_case_types)] doesn't work for individual enum variant #38452

Closed
Riateche opened this issue Dec 18, 2016 · 1 comment
Closed
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@Riateche
Copy link

#[allow(non_camel_case_types)] only works if applied to the whole enum. If applied to a variant, it does nothing.

enum A {
    #[allow(non_camel_case_types)]
    B_B
}

It should either suppress the warning for that variant or give an error or warning that this directive can't be applied in this context.

@apasel422 apasel422 added the A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. label Dec 20, 2016
frewsxcv added a commit to frewsxcv/rust that referenced this issue Feb 14, 2017
…etrochenkov

Use check_variant for non_camel_case_types lint

This way we automatically consider lint attributes.

Fix rust-lang#38452.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Feb 14, 2017
…etrochenkov

Use check_variant for non_camel_case_types lint

This way we automatically consider lint attributes.

Fix rust-lang#38452.
@acelot
Copy link

acelot commented Sep 10, 2020

Understand. As a workaround, I've just suppress the warnings for the module.

#![allow(non_camel_case_types)]
pub mod gen_pages;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

No branches or pull requests

3 participants