+ let sc_ident = Ident::from_str_and_span(&sc, ident.span);
+ let (message, suggestion) = if sc_ident.is_reserved() {
+ // We shouldn't suggest a reserved identifier to fix non-snake-case identifiers.
+ // Instead, recommend renaming the identifier entirely or, if permitted,
+ // escaping it to create a raw identifier.
+ if sc_ident.name.can_be_raw() {
+ ("rename the identifier or convert it to a snake case raw identifier", sc_ident.to_string())
+ } else {
+ ("rename the identifier", String::new())
+ }
+ } else {
+ ("convert the identifier to snake case", sc)
+ };
+