diff options
Diffstat (limited to 'crates/ra_hir_def/src/body/lower.rs')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 4f23cb5c8..b0d71eb3d 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -372,7 +372,7 @@ impl ExprCollector<'_> { | |||
372 | } | 372 | } |
373 | ast::Expr::RefExpr(e) => { | 373 | ast::Expr::RefExpr(e) => { |
374 | let expr = self.collect_expr_opt(e.expr()); | 374 | let expr = self.collect_expr_opt(e.expr()); |
375 | let mutability = Mutability::from_mutable(e.mut_kw_token().is_some()); | 375 | let mutability = Mutability::from_mutable(e.mut_token().is_some()); |
376 | self.alloc_expr(Expr::Ref { expr, mutability }, syntax_ptr) | 376 | self.alloc_expr(Expr::Ref { expr, mutability }, syntax_ptr) |
377 | } | 377 | } |
378 | ast::Expr::PrefixExpr(e) => { | 378 | ast::Expr::PrefixExpr(e) => { |
@@ -587,10 +587,8 @@ impl ExprCollector<'_> { | |||
587 | let pattern = match &pat { | 587 | let pattern = match &pat { |
588 | ast::Pat::BindPat(bp) => { | 588 | ast::Pat::BindPat(bp) => { |
589 | let name = bp.name().map(|nr| nr.as_name()).unwrap_or_else(Name::missing); | 589 | let name = bp.name().map(|nr| nr.as_name()).unwrap_or_else(Name::missing); |
590 | let annotation = BindingAnnotation::new( | 590 | let annotation = |
591 | bp.mut_kw_token().is_some(), | 591 | BindingAnnotation::new(bp.mut_token().is_some(), bp.ref_token().is_some()); |
592 | bp.ref_kw_token().is_some(), | ||
593 | ); | ||
594 | let subpat = bp.pat().map(|subpat| self.collect_pat(subpat)); | 592 | let subpat = bp.pat().map(|subpat| self.collect_pat(subpat)); |
595 | if annotation == BindingAnnotation::Unannotated && subpat.is_none() { | 593 | if annotation == BindingAnnotation::Unannotated && subpat.is_none() { |
596 | // This could also be a single-segment path pattern. To | 594 | // This could also be a single-segment path pattern. To |
@@ -631,7 +629,7 @@ impl ExprCollector<'_> { | |||
631 | } | 629 | } |
632 | ast::Pat::RefPat(p) => { | 630 | ast::Pat::RefPat(p) => { |
633 | let pat = self.collect_pat_opt(p.pat()); | 631 | let pat = self.collect_pat_opt(p.pat()); |
634 | let mutability = Mutability::from_mutable(p.mut_kw_token().is_some()); | 632 | let mutability = Mutability::from_mutable(p.mut_token().is_some()); |
635 | Pat::Ref { pat, mutability } | 633 | Pat::Ref { pat, mutability } |
636 | } | 634 | } |
637 | ast::Pat::PathPat(p) => { | 635 | ast::Pat::PathPat(p) => { |