1
Fork 0

Rollup merge of #100978 - nnethercote:fix-100948, r=petrochenkov

Handle `Err` in `ast::LitKind::to_token_lit`.

Fixes #100948.

r? ``@petrochenkov``
This commit is contained in:
Yuki Okushi 2022-08-26 09:51:46 +09:00 committed by GitHub
commit d4a5ec17a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 1 deletions

View file

@ -199,7 +199,9 @@ impl LitKind {
let symbol = if value { kw::True } else { kw::False };
(token::Bool, symbol, None)
}
LitKind::Err => unreachable!(),
// This only shows up in places like `-Zunpretty=hir` output, so we
// don't bother to produce something useful.
LitKind::Err => (token::Err, Symbol::intern("<bad-literal>"), None),
};
token::Lit::new(kind, symbol, suffix)