Rollup merge of #110873 - clubby789:migrate-rustc-parse-trivial, r=compiler-errors

Migrate trivially translatable `rustc_parse` diagnostics

cc #100717

Migrate diagnostics in `rustc_parse` which are emitted in a single statement. I worked on this by expanding the lint introduced in #108760, although that isn't included here as there is much more work to be done to satisfy it
This commit is contained in:
Matthias Krüger 2023-04-28 07:34:02 +02:00 committed by GitHub
commit 29f5ec3640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 443 additions and 231 deletions

View file

@ -2976,7 +2976,7 @@ pub enum ItemKind {
}
impl ItemKind {
pub fn article(&self) -> &str {
pub fn article(&self) -> &'static str {
use ItemKind::*;
match self {
Use(..) | Static(..) | Const(..) | Fn(..) | Mod(..) | GlobalAsm(..) | TyAlias(..)
@ -2985,7 +2985,7 @@ impl ItemKind {
}
}
pub fn descr(&self) -> &str {
pub fn descr(&self) -> &'static str {
match self {
ItemKind::ExternCrate(..) => "extern crate",
ItemKind::Use(..) => "`use` import",