Skip to content

Clean up snake case warnings in middle/trans/build.rs #16880

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

Closed
zslayton opened this issue Aug 30, 2014 · 6 comments · Fixed by #17063
Closed

Clean up snake case warnings in middle/trans/build.rs #16880

zslayton opened this issue Aug 30, 2014 · 6 comments · Fixed by #17063

Comments

@zslayton
Copy link
Contributor

When building rustc, several warnings are generated regarding non-snake-case functions in middle/trans/build.rs.

There's a #![allow(non_snake_case)] directive at the top, but no #![allow(non_snake_case_functions)]. Presumably we should either add that to permit the functions as they're currently named or rename the functions.

Happy to work on this! Which approach should I take?

@zslayton
Copy link
Contributor Author

Upon further review, it appears that the issue is actually that the directive #!allow(non_snake_case) changed at some point to be #!allow(non_snake_case_functions). There are a large number of files still using non_snake_case, generating warnings like the following:

warning: unknown `allow` attribute: `non_snake_case`, #[warn(unrecognized_lint)] on by default

I can run through and update all of these if someone can confirm for me that my assumption is correct.

@zslayton
Copy link
Contributor Author

Upon further-further review, I discovered this very recent commit that modified non_snake_case_functions. It looks like perhaps the new non_snake_case lint isn't being recognized?

I'm going to settle down and let someone that knows what they're talking about comment on this. :)

@steveklabnik
Copy link
Member

Yeah, still getting a lot of these.

steveklabnik referenced this issue Sep 5, 2014
This unifies the `non_snake_case_functions` and `uppercase_variables` lints
into one lint, `non_snake_case`. It also now checks for non-snake-case modules.
This also extends the non-camel-case types lint to check type parameters, and
merges the `non_uppercase_pattern_statics` lint into the
`non_uppercase_statics` lint.

Because the `uppercase_variables` lint is now part of the `non_snake_case`
lint, all non-snake-case variables that start with lowercase characters (such
as `fooBar`) will now trigger the `non_snake_case` lint.

New code should be updated to use the new `non_snake_case` lint instead of the
previous `non_snake_case_functions` and `uppercase_variables` lints. All use of
the `non_uppercase_pattern_statics` should be replaced with the
`non_uppercase_statics` lint. Any code that previously contained non-snake-case
module or variable names should be updated to use snake case names or disable
the `non_snake_case` lint. Any code with non-camel-case type parameters should
be changed to use camel case or disable the `non_camel_case_types` lint.

[breaking-change]
@ftxqxd
Copy link
Contributor

ftxqxd commented Sep 5, 2014

As I noted in the original pull request that caused this change, a snapshot would fix this. A temporary fix would be to add #[allow(non_snake_case_functions)] or #[allow(uppercase_variables)] wherever #[allow(non_snake_case)] occurs at the moment. This would silence most errors, but create a few new ones (significantly fewer than what there are now, however). To completely silence all errors, we’d need a #[cfg_attr(...)] attribute or something similar.

@steveklabnik
Copy link
Member

Ahh, I am bad at github-fu.

Yes, if this is going to be fixed by a snapshot, then this bug probably isn't actionable. Do we know when the next snapshot is?

@steveklabnik
Copy link
Member

@huonw is on the case!

huonw added a commit to huonw/rust that referenced this issue Sep 7, 2014
bors added a commit that referenced this issue Sep 8, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 31, 2024
Use `--workspace` and `--no-fail-fast` in test explorer

This PR contains:
* Using `--workspace` in `cargo test` command, to running all tests even when there is a crate in the root of a workspace
* Using `--no-fail-fast` to run all requested tests
* Excluding bench in the test explorer
* Fixing a bug in the `hack_recover_crate_name`

fix rust-lang#16874
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

Successfully merging a pull request may close this issue.

3 participants