-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
This code
fn r<r#trait>() {}
fn main() {
r();
}
Gives incorrect warning and error for type declared using raw identifiers:
warning: type parameter `trait` should have an upper camel case name
--> src/main.rs:1:6
|
1 | fn r<r#trait>() {}
| ^^^^^^^ help: convert the identifier to upper camel case: `Trait`
|
= note: `#[warn(non_camel_case_types)]` on by default
error[E0282]: type annotations needed
--> src/main.rs:4:5
|
4 | r();
| ^ cannot infer type for type parameter `trait`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0282`.
error: could not compile `playground`.
NOTE: This is about the diagnostics not including the r#
in each case.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.