Migrate trivially translatable rustc_parse diagnostics
This commit is contained in:
@@ -43,7 +43,7 @@ use thin_vec::ThinVec;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::errors::{
|
||||
IncorrectVisibilityRestriction, MismatchedClosingDelimiter, NonStringAbiLiteral,
|
||||
self, IncorrectVisibilityRestriction, MismatchedClosingDelimiter, NonStringAbiLiteral,
|
||||
};
|
||||
|
||||
bitflags::bitflags! {
|
||||
@@ -663,15 +663,10 @@ impl<'a> Parser<'a> {
|
||||
if case == Case::Insensitive
|
||||
&& let Some((ident, /* is_raw */ false)) = self.token.ident()
|
||||
&& ident.as_str().to_lowercase() == kw.as_str().to_lowercase() {
|
||||
self
|
||||
.struct_span_err(ident.span, format!("keyword `{kw}` is written in a wrong case"))
|
||||
.span_suggestion(
|
||||
ident.span,
|
||||
"write it in the correct case",
|
||||
kw,
|
||||
Applicability::MachineApplicable
|
||||
).emit();
|
||||
|
||||
self.sess.emit_err(errors::KwBadCase {
|
||||
span: ident.span,
|
||||
kw: kw.as_str()
|
||||
});
|
||||
self.bump();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user