Skip to content

non_camel_case_types does not trigger for screaming single-word #116336

Open
@jonhoo

Description

@jonhoo

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

Metadata

Metadata

Assignees

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.L-non_camel_case_typesLint: non_camel_case_typesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions