Desugar while let
into loop { match { ... } }
This commit is contained in:
parent
0c2c8116a3
commit
b003f10449
2 changed files with 10 additions and 1 deletions
|
@ -147,6 +147,8 @@ pub trait AstBuilder {
|
|||
fn expr_some(&self, sp: Span, expr: P<ast::Expr>) -> P<ast::Expr>;
|
||||
fn expr_none(&self, sp: Span) -> P<ast::Expr>;
|
||||
|
||||
fn expr_break(&self, sp: Span) -> P<ast::Expr>;
|
||||
|
||||
fn expr_tuple(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr>;
|
||||
|
||||
fn expr_fail(&self, span: Span, msg: InternedString) -> P<ast::Expr>;
|
||||
|
@ -688,6 +690,12 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
|||
self.expr_path(none)
|
||||
}
|
||||
|
||||
|
||||
fn expr_break(&self, sp: Span) -> P<ast::Expr> {
|
||||
self.expr(sp, ast::ExprBreak(None))
|
||||
}
|
||||
|
||||
|
||||
fn expr_tuple(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
|
||||
self.expr(sp, ast::ExprTup(exprs))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue