From 9909ccb4f4a25314f0b831d56c8447345d8fa396 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 11 Oct 2020 18:27:38 +0200 Subject: Fix `mut self` not emitting mutable binding on `self` use --- crates/hir_def/src/body/lower.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/hir_def') diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs index 2d91bb21f..01e72690a 100644 --- a/crates/hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs @@ -107,7 +107,10 @@ impl ExprCollector<'_> { let param_pat = self.alloc_pat( Pat::Bind { name: name![self], - mode: BindingAnnotation::Unannotated, + mode: BindingAnnotation::new( + self_param.mut_token().is_some() && self_param.amp_token().is_none(), + false, + ), subpat: None, }, Either::Right(ptr), -- cgit v1.2.3