Rollup merge of #132332 - nnethercote:use-token_descr-more, r=estebank

Use `token_descr` more in error messages

This is the first two commits from #124141, put into their own PR to get things rolling. Commit messages have the details.

r? ``@estebank``
cc ``@petrochenkov``
This commit is contained in:
Matthias Krüger
2024-10-30 06:40:36 +01:00
committed by GitHub
77 changed files with 152 additions and 159 deletions

View File

@@ -424,7 +424,7 @@ impl TokenDescription {
}
}
pub(super) fn token_descr(token: &Token) -> String {
pub fn token_descr(token: &Token) -> String {
let name = pprust::token_to_string(token).to_string();
let kind = match (TokenDescription::from_token(token), &token.kind) {