mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
Fix mut self
not emitting mutable binding on self
use
This commit is contained in:
parent
cde189c5d5
commit
9909ccb4f4
@ -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),
|
||||
|
@ -62,7 +62,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
|
||||
|
||||
<span class="keyword">impl</span> <span class="struct">Foo</span> <span class="punctuation">{</span>
|
||||
<span class="keyword">fn</span> <span class="function declaration">baz</span><span class="punctuation">(</span><span class="keyword">mut</span> <span class="self_keyword mutable">self</span><span class="punctuation">,</span> <span class="value_param declaration">f</span><span class="punctuation">:</span> <span class="struct">Foo</span><span class="punctuation">)</span> <span class="operator">-></span> <span class="builtin_type">i32</span> <span class="punctuation">{</span>
|
||||
<span class="value_param">f</span><span class="punctuation">.</span><span class="function consuming">baz</span><span class="punctuation">(</span><span class="self_keyword consuming">self</span><span class="punctuation">)</span>
|
||||
<span class="value_param">f</span><span class="punctuation">.</span><span class="function consuming">baz</span><span class="punctuation">(</span><span class="self_keyword mutable consuming">self</span><span class="punctuation">)</span>
|
||||
<span class="punctuation">}</span>
|
||||
|
||||
<span class="keyword">fn</span> <span class="function declaration">qux</span><span class="punctuation">(</span><span class="operator">&</span><span class="keyword">mut</span> <span class="self_keyword mutable">self</span><span class="punctuation">)</span> <span class="punctuation">{</span>
|
||||
|
Loading…
Reference in New Issue
Block a user