Improve a local variable name.
This commit is contained in:
parent
6fdaf3ef7f
commit
cd4c5cd8b8
@ -198,12 +198,12 @@ pub(crate) fn report_mutability_error(
|
|||||||
{
|
{
|
||||||
let span = self.body.local_decls[local].source_info.span;
|
let span = self.body.local_decls[local].source_info.span;
|
||||||
mut_error = Some(span);
|
mut_error = Some(span);
|
||||||
if let Some((buffer, c)) = self.get_buffered_mut_error(span) {
|
if let Some((buffered_err, c)) = self.get_buffered_mut_error(span) {
|
||||||
// We've encountered a second (or more) attempt to mutably borrow an
|
// We've encountered a second (or more) attempt to mutably borrow an
|
||||||
// immutable binding, so the likely problem is with the binding
|
// immutable binding, so the likely problem is with the binding
|
||||||
// declaration, not the use. We collect these in a single diagnostic
|
// declaration, not the use. We collect these in a single diagnostic
|
||||||
// and make the binding the primary span of the error.
|
// and make the binding the primary span of the error.
|
||||||
err = buffer;
|
err = buffered_err;
|
||||||
count = c + 1;
|
count = c + 1;
|
||||||
if count == 2 {
|
if count == 2 {
|
||||||
err.replace_span_with(span, false);
|
err.replace_span_with(span, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user