mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Add snake case lint note about keyword identifiers which cannot be raw
This commit is contained in:
parent
91f436b456
commit
750c52af73
@ -283,6 +283,7 @@ impl NonSnakeCase {
|
|||||||
if sc_ident.name.can_be_raw() {
|
if sc_ident.name.can_be_raw() {
|
||||||
("rename the identifier or convert it to a snake case raw identifier", sc_ident.to_string())
|
("rename the identifier or convert it to a snake case raw identifier", sc_ident.to_string())
|
||||||
} else {
|
} else {
|
||||||
|
err.note(&format!("`{}` cannot be used as a raw identifier", sc));
|
||||||
("rename the identifier", String::new())
|
("rename the identifier", String::new())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -60,6 +60,8 @@ error: variable `Super` should have a snake case name
|
|||||||
|
|
|
|
||||||
LL | let Super: usize = 0;
|
LL | let Super: usize = 0;
|
||||||
| ^^^^^ help: rename the identifier
|
| ^^^^^ help: rename the identifier
|
||||||
|
|
|
||||||
|
= note: `super` cannot be used as a raw identifier
|
||||||
|
|
||||||
error: aborting due to 4 previous errors; 2 warnings emitted
|
error: aborting due to 4 previous errors; 2 warnings emitted
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user