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

The lint non_camel_case_types ignores inherent associated types #105341

Closed
fmease opened this issue Dec 6, 2022 · 0 comments · Fixed by #105768
Closed

The lint non_camel_case_types ignores inherent associated types #105341

fmease opened this issue Dec 6, 2022 · 0 comments · Fixed by #105768
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. F-inherent_associated_types `#![feature(inherent_associated_types)]` requires-nightly This issue requires a nightly compiler in some way.

Comments

@fmease
Copy link
Member

fmease commented Dec 6, 2022

The following code compiles successfully when it should not due to S::typ not having an upper camel case name.

#![feature(inherent_associated_types)]
#![allow(incomplete_features, dead_code)]
#![deny(non_camel_case_types)]

struct S;

impl S {
    type typ = ();
}

Meta

rustc -Vv:

rustc 1.67.0-nightly (53e4b9dd7 2022-12-04)
binary: rustc
commit-hash: 53e4b9dd74c29cc9308b8d0f10facac70bb101a7
commit-date: 2022-12-04
host: x86_64-unknown-linux-gnu
release: 1.67.0-nightly
LLVM version: 15.0.4

@rustbot label A-lint requires-nightly F-inherent_associated_types

@fmease fmease added the C-bug Category: This is a bug. label Dec 6, 2022
@rustbot rustbot added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. F-inherent_associated_types `#![feature(inherent_associated_types)]` requires-nightly This issue requires a nightly compiler in some way. labels Dec 6, 2022
@fee1-dead fee1-dead self-assigned this Dec 16, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 16, 2022
Detect inherent associated types not having CamelCase

Fixes rust-lang#105341.
@bors bors closed this as completed in 08a0e71 Dec 17, 2022
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. F-inherent_associated_types `#![feature(inherent_associated_types)]` requires-nightly This issue requires a nightly compiler in some way.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants