|
8 | 8 | // option. This file may not be copied, modified, or distributed |
9 | 9 | // except according to those terms. |
10 | 10 |
|
| 11 | +use rustc_data_structures::sync::Lrc; |
11 | 12 | use rustc_target::spec::abi::Abi; |
12 | 13 | use ast::{self, Ident, Generics, Expr, BlockCheckMode, UnOp, PatKind}; |
13 | 14 | use attr; |
@@ -145,6 +146,7 @@ pub trait AstBuilder { |
145 | 146 | fn expr_vec_ng(&self, sp: Span) -> P<ast::Expr>; |
146 | 147 | fn expr_vec_slice(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr>; |
147 | 148 | fn expr_str(&self, sp: Span, s: Symbol) -> P<ast::Expr>; |
| 149 | + fn expr_byte_str(&self, sp: Span, byte_str: Vec<u8>) -> P<ast::Expr>; |
148 | 150 |
|
149 | 151 | fn expr_some(&self, sp: Span, expr: P<ast::Expr>) -> P<ast::Expr>; |
150 | 152 | fn expr_none(&self, sp: Span) -> P<ast::Expr>; |
@@ -736,6 +738,10 @@ impl<'a> AstBuilder for ExtCtxt<'a> { |
736 | 738 | self.expr_lit(sp, ast::LitKind::Str(s, ast::StrStyle::Cooked)) |
737 | 739 | } |
738 | 740 |
|
| 741 | + fn expr_byte_str(&self, sp: Span, byte_str: Vec<u8>) -> P<ast::Expr> { |
| 742 | + self.expr_lit(sp, ast::LitKind::ByteStr(Lrc::new(byte_str))) |
| 743 | + } |
| 744 | + |
739 | 745 | fn expr_cast(&self, sp: Span, expr: P<ast::Expr>, ty: P<ast::Ty>) -> P<ast::Expr> { |
740 | 746 | self.expr(sp, ast::ExprKind::Cast(expr, ty)) |
741 | 747 | } |
|
0 commit comments