-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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_snake_case)] ignored #6541
Comments
I think this wasn't completely implemented in #6421, CC @popzxc Sample code: #![allow(non_snake_case)]
fn main() {
#[allow(non_snake_case)]
let FOO_BAR = 42;
drop(FOO_BAR);
} It's also shown twice, not sure why.
It's not. This one works as you type, but for |
Yep, the support of this attribute is very basic, thus it is kind of expected. |
Shouldn't |
In theory, yes. However I could have skipped checking for attribute somewhere. Anyway, unfortunately it doesn't seem that I'd be free from main work in the following couple of weeks to fix this :( |
We suppress variable name convention lints in a couple of spots. While that works for `rustc`, unfortunately the variable names still trip a different lint in `rust-analyzer` (see [1]). Fortunately, there's a workaround: hoist the `#[allow()]` up to the enclosing item (in our case, functions) instead of the individual line. [1]: rust-lang/rust-analyzer#6541
We suppress variable name convention lints in a couple of spots. While that works for `rustc`, unfortunately the variable names still trip a different lint in `rust-analyzer` (see [1]). Fortunately, there's a workaround: hoist the `#[allow()]` up to the enclosing item (in our case, functions) instead of the individual line. [1]: rust-lang/rust-analyzer#6541
The |
Hey, I'm not sure if this is a problem on my end, but when adding Code for reference:
Am I doing something wrong? Is this intended? |
Can it be that you confuse what both lints are responsible for or did I misunderstand you? See what both #![allow(dead_code)]
#![allow(non_snake_case)]
#[allow(non_camel_case_types)]
struct responseData {
deviceName: String,
_id: String,
focus: i128,
} The problem with your snippet is |
My bad, I got confused. It works now, thank you for clarifying. |
The linter ignores
#[allow(non_snake_case)]
and warns about »… should have snake_case name, e.g. `…`«. In fact, this lint is redundant to the rustc-lint.The text was updated successfully, but these errors were encountered: