Skip to content

mod Keyword {} should suggest r#keyword instead of keyword #80575

Closed
@Havvy

Description

@Havvy

When you write a mod with a capital name of a keyword, we suggest changing it to the lowercase version of the keyword, which is, well, a keyword and not going to work. We should suggest converting the identifier to snake case and making it a raw identifier, or maybe suggest switching to an altogether separate name?

  |
1 | mod Impl {}
  |     ^^^^ help: convert the identifier to snake case (notice the capitalization): `impl`
  |
  = note: `#[warn(non_snake_case)]` on by default

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsD-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.D-papercutDiagnostics: An error or lint that needs small tweaks.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions