mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Detect "bound more than once" error and suppress need-mut
for it.
This commit is contained in:
parent
08f89193b5
commit
71f3e4b08c
4 changed files with 84 additions and 8 deletions
|
@ -1643,7 +1643,11 @@ impl DefWithBody {
|
|||
)
|
||||
}
|
||||
let mol = &borrowck_result.mutability_of_locals;
|
||||
for (binding_id, _) in hir_body.bindings.iter() {
|
||||
for (binding_id, binding_data) in hir_body.bindings.iter() {
|
||||
if binding_data.problems.is_some() {
|
||||
// We should report specific diagnostics for these problems, not `need-mut` and `unused-mut`.
|
||||
continue;
|
||||
}
|
||||
let Some(&local) = mir_body.binding_locals.get(binding_id) else {
|
||||
continue;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue