mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Desugar while let into loop { match { ... } }
This commit is contained in:
@@ -581,7 +581,8 @@ pub struct QPath {
|
||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||
pub enum MatchSource {
|
||||
MatchNormal,
|
||||
MatchIfLetDesugar
|
||||
MatchIfLetDesugar,
|
||||
MatchWhileLetDesugar,
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||
|
||||
@@ -147,6 +147,8 @@ fn expr_struct_ident(&self, span: Span, id: ast::Ident,
|
||||
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 @@ fn expr_none(&self, sp: Span) -> P<ast::Expr> {
|
||||
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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user