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

Naming convention for static mut is not enforced #37145

Closed
matklad opened this issue Oct 13, 2016 · 2 comments
Closed

Naming convention for static mut is not enforced #37145

matklad opened this issue Oct 13, 2016 · 2 comments
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@matklad
Copy link
Member

matklad commented Oct 13, 2016

The following program does not report any naming convention warnings:

#![allow(dead_code)]

static mut snake_case: u32 = 0;
static mut camelCase: u32 = 0;
static mut SCREAMING_SNAKE_CASE: u32 = 0;
static mut CapitalizedCamelCase: u32 = 0;

fn main() {}

Looks like only SCREAMING_SNAKE_CASE should be allowed? If I remove muts, I get the warnings. Or have we already deprecated static muts (pre rfc: https://internals.rust-lang.org/t/pre-rfc-remove-static-mut/1437/20) ?

@apasel422 apasel422 added the A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. label Oct 13, 2016
@sfackler
Copy link
Member

Static muts are not deprecated. This looks like it's just an oversight in those lints. The convention should be identical to normal statics.

@matklad
Copy link
Member Author

matklad commented Oct 14, 2016

Ok, I'll try to submit a PR then.

bors added a commit that referenced this issue Oct 17, 2016
Lint against lowercase static mut

Closes #37145.

Lint for non mut statics was added in #7523, and it explicitly did not cover mut statics. I am not sure why.
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