1
Fork 0

inline format!() args up to and including rustc_middle

This commit is contained in:
Matthias Krüger 2023-07-25 22:00:13 +02:00
parent 2e0136a131
commit 23815467a2
87 changed files with 378 additions and 437 deletions

View file

@ -375,7 +375,7 @@ impl TokenType {
fn to_string(&self) -> String {
match self {
TokenType::Token(t) => format!("`{}`", pprust::token_kind_to_string(t)),
TokenType::Keyword(kw) => format!("`{}`", kw),
TokenType::Keyword(kw) => format!("`{kw}`"),
TokenType::Operator => "an operator".to_string(),
TokenType::Lifetime => "lifetime".to_string(),
TokenType::Ident => "identifier".to_string(),
@ -445,7 +445,7 @@ pub(super) fn token_descr(token: &Token) -> String {
TokenDescription::DocComment => "doc comment",
});
if let Some(kind) = kind { format!("{} `{}`", kind, name) } else { format!("`{}`", name) }
if let Some(kind) = kind { format!("{kind} `{name}`") } else { format!("`{name}`") }
}
impl<'a> Parser<'a> {
@ -929,7 +929,7 @@ impl<'a> Parser<'a> {
expect_err
.span_suggestion_short(
sp,
format!("missing `{}`", token_str),
format!("missing `{token_str}`"),
token_str,
Applicability::MaybeIncorrect,
)