diff options
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 032037c8c..df560155c 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -587,7 +587,10 @@ 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(bp.is_mutable(), bp.is_ref()); | 590 | let annotation = BindingAnnotation::new( |
591 | bp.mut_kw_token().is_some(), | ||
592 | bp.ref_kw_token().is_some(), | ||
593 | ); | ||
591 | let subpat = bp.pat().map(|subpat| self.collect_pat(subpat)); | 594 | let subpat = bp.pat().map(|subpat| self.collect_pat(subpat)); |
592 | if annotation == BindingAnnotation::Unannotated && subpat.is_none() { | 595 | if annotation == BindingAnnotation::Unannotated && subpat.is_none() { |
593 | // This could also be a single-segment path pattern. To | 596 | // This could also be a single-segment path pattern. To |
@@ -628,7 +631,7 @@ impl ExprCollector<'_> { | |||
628 | } | 631 | } |
629 | ast::Pat::RefPat(p) => { | 632 | ast::Pat::RefPat(p) => { |
630 | let pat = self.collect_pat_opt(p.pat()); | 633 | let pat = self.collect_pat_opt(p.pat()); |
631 | let mutability = Mutability::from_mutable(p.is_mut()); | 634 | let mutability = Mutability::from_mutable(p.mut_kw_token().is_some()); |
632 | Pat::Ref { pat, mutability } | 635 | Pat::Ref { pat, mutability } |
633 | } | 636 | } |
634 | ast::Pat::PathPat(p) => { | 637 | ast::Pat::PathPat(p) => { |