Produce a better error for irrefutable if let
patterns
Modify ast::ExprMatch to include a new value of type ast::MatchSource, making it easy to tell whether the match was written literally or produced via desugaring. This allows us to customize error messages appropriately.
This commit is contained in:
parent
1bc407fb84
commit
976438f78f
20 changed files with 115 additions and 23 deletions
|
@ -845,7 +845,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
|||
}
|
||||
|
||||
fn expr_match(&self, span: Span, arg: P<ast::Expr>, arms: Vec<ast::Arm>) -> P<Expr> {
|
||||
self.expr(span, ast::ExprMatch(arg, arms))
|
||||
self.expr(span, ast::ExprMatch(arg, arms, ast::MatchNormal))
|
||||
}
|
||||
|
||||
fn expr_if(&self, span: Span, cond: P<ast::Expr>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue