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

bad_style doesn't fire for associated types #67920

Closed
est31 opened this issue Jan 6, 2020 · 2 comments · Fixed by #67936
Closed

bad_style doesn't fire for associated types #67920

est31 opened this issue Jan 6, 2020 · 2 comments · Fixed by #67936
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@est31
Copy link
Member

est31 commented Jan 6, 2020

Associated types are types and thus should be capitalized. I think most code also does this. Recently I accidentally didn't capitalize it and was surprised that it doesn't lint for it:

pub trait Foo {
    type hello;
}

I'd expect it to say something.

This issue has been assigned to @Fibration via this comment.

@csmoe csmoe added A-diagnostics Area: Messages for errors, warnings, and lints A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. labels Jan 6, 2020
@csmoe
Copy link
Member

csmoe commented Jan 6, 2020

bad_style checking happens inside src/librustc_lint/nonstandard_style.rs, add check_trait_item for NonCamelCaseTypes, then inspect the kind of AssocitemKind inside this checking.

@csmoe csmoe added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Jan 6, 2020
@Centril Centril added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 6, 2020
@Fibration
Copy link

I'd like to put my hand up for this if that's alright? It looks like a good one to get started on.

@rustbot claim

@rustbot rustbot self-assigned this Jan 6, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jan 6, 2020
fire "non_camel_case_types" for associated types

Fixes rust-lang#67920.
@bors bors closed this as completed in b065031 Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants