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

non_camel_case_types does not trigger for screaming single-word #116336

Open
jonhoo opened this issue Oct 2, 2023 · 3 comments
Open

non_camel_case_types does not trigger for screaming single-word #116336

jonhoo opened this issue Oct 2, 2023 · 3 comments
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. L-non_camel_case_types Lint: non_camel_case_types T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Oct 2, 2023

I tried this code:

#![deny(non_camel_case_types)]

pub struct FOO;

pub enum BAR {
    BAZ,
}

fn main() {}

I expected to see this happen: FOO, BAR, and BAZ should all trigger the non_camel_case_types lint (at least assuming it follows RFC430), and so the code should not compile.

Instead, this happened: The code compiled with no warnings. All three cases start triggering the lint if something like _X is added to them.

Meta

rustc --version --verbose:

rustc 1.73.0-beta.4 (9f37cd4f7 2023-09-01)
binary: rustc
commit-hash: 9f37cd4f79d289492ccaa8f28733b765498c95e5
commit-date: 2023-09-01
host: aarch64-apple-darwin
release: 1.73.0-beta.4
LLVM version: 17.0.0
@jonhoo jonhoo added the C-bug Category: This is a bug. label Oct 2, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 2, 2023
@fmease fmease added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 2, 2023
@sjwang05
Copy link
Contributor

sjwang05 commented Oct 2, 2023

@rustbot claim

@kadiwa4
Copy link
Contributor

kadiwa4 commented Oct 3, 2023

Related: #60570, which describes drawbacks of always disallowing uppercase type names

@joshtriplett
Copy link
Member

#60570 (comment)

@jieyouxu jieyouxu added the L-non_camel_case_types Lint: non_camel_case_types label May 13, 2024
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. C-bug Category: This is a bug. L-non_camel_case_types Lint: non_camel_case_types 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.

7 participants