Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkov

Remove `ast::Guard`

With the introduction of `ast::ExprKind::Let` in https://github.com/rust-lang/rust/pull/60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](https://github.com/rust-lang/rust/issues/51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here.

However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...).

r? @petrochenkov
This commit is contained in:
bors 2019-06-24 05:00:10 +00:00
commit 3cc3486733
8 changed files with 14 additions and 36 deletions

View file

@ -893,16 +893,11 @@ pub struct Local {
pub struct Arm {
pub attrs: Vec<Attribute>,
pub pats: Vec<P<Pat>>,
pub guard: Option<Guard>,
pub guard: Option<P<Expr>>,
pub body: P<Expr>,
pub span: Span,
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub enum Guard {
If(P<Expr>),
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub struct Field {
pub ident: Ident,