1
Fork 0

Auto merge of #105160 - nnethercote:rm-Lit-token_lit, r=petrochenkov

Remove `token::Lit` from `ast::MetaItemLit`.

Currently `ast::MetaItemLit` represents the literal kind twice. This PR removes that redundancy. Best reviewed one commit at a time.

r? `@petrochenkov`
This commit is contained in:
bors 2022-12-12 05:16:50 +00:00
commit 2cd2070af7
28 changed files with 244 additions and 171 deletions

View file

@ -97,7 +97,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
ExprKind::IncludedBytes(bytes) => hir::ExprKind::Lit(respan(
self.lower_span(e.span),
LitKind::ByteStr(bytes.clone()),
LitKind::ByteStr(bytes.clone(), StrStyle::Cooked),
)),
ExprKind::Cast(expr, ty) => {
let expr = self.lower_expr(expr);

View file

@ -958,7 +958,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
lit
} else {
MetaItemLit {
token_lit: token::Lit::new(token::LitKind::Err, kw::Empty, None),
symbol: kw::Empty,
suffix: None,
kind: LitKind::Err,
span: DUMMY_SP,
}