use hir::Let in hir::Guard
This commit is contained in:
parent
4799baa70d
commit
5251a80c0a
13 changed files with 41 additions and 45 deletions
|
@ -1312,8 +1312,7 @@ pub struct Let<'hir> {
|
|||
#[derive(Debug, HashStable_Generic)]
|
||||
pub enum Guard<'hir> {
|
||||
If(&'hir Expr<'hir>),
|
||||
// FIXME use hir::Let for this.
|
||||
IfLet(&'hir Pat<'hir>, &'hir Expr<'hir>),
|
||||
IfLet(&'hir Let<'hir>),
|
||||
}
|
||||
|
||||
#[derive(Debug, HashStable_Generic)]
|
||||
|
|
|
@ -1233,9 +1233,8 @@ pub fn walk_arm<'v, V: Visitor<'v>>(visitor: &mut V, arm: &'v Arm<'v>) {
|
|||
if let Some(ref g) = arm.guard {
|
||||
match g {
|
||||
Guard::If(ref e) => visitor.visit_expr(e),
|
||||
Guard::IfLet(ref pat, ref e) => {
|
||||
visitor.visit_pat(pat);
|
||||
visitor.visit_expr(e);
|
||||
Guard::IfLet(ref l) => {
|
||||
visitor.visit_let_expr(l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue