Introduce ExprKind::IncludedBytes
This commit is contained in:
parent
b7b7f2716e
commit
b2da155a9a
19 changed files with 78 additions and 15 deletions
|
@ -87,6 +87,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
ExprKind::Lit(ref l) => {
|
||||
hir::ExprKind::Lit(respan(self.lower_span(l.span), l.kind.clone()))
|
||||
}
|
||||
ExprKind::IncludedBytes(ref bytes) => hir::ExprKind::Lit(respan(
|
||||
self.lower_span(e.span),
|
||||
LitKind::ByteStr(bytes.clone()),
|
||||
)),
|
||||
ExprKind::Cast(ref expr, ref ty) => {
|
||||
let expr = self.lower_expr(expr);
|
||||
let ty =
|
||||
|
|
|
@ -323,7 +323,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
// ```
|
||||
fn lower_expr_within_pat(&mut self, expr: &Expr, allow_paths: bool) -> &'hir hir::Expr<'hir> {
|
||||
match expr.kind {
|
||||
ExprKind::Lit(..) | ExprKind::ConstBlock(..) | ExprKind::Err => {}
|
||||
ExprKind::Lit(..)
|
||||
| ExprKind::ConstBlock(..)
|
||||
| ExprKind::IncludedBytes(..)
|
||||
| ExprKind::Err => {}
|
||||
ExprKind::Path(..) if allow_paths => {}
|
||||
ExprKind::Unary(UnOp::Neg, ref inner) if matches!(inner.kind, ExprKind::Lit(_)) => {}
|
||||
_ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue