mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Fix explicit deref problems in closure capture
This commit is contained in:
parent
1ee88db412
commit
7cb4318331
4 changed files with 90 additions and 4 deletions
|
@ -1564,7 +1564,10 @@ impl DefWithBody {
|
|||
}
|
||||
(mir::MutabilityReason::Not, true) => {
|
||||
if !infer.mutated_bindings_in_closure.contains(&binding_id) {
|
||||
acc.push(UnusedMut { local }.into())
|
||||
let should_ignore = matches!(body[binding_id].name.as_str(), Some(x) if x.starts_with("_"));
|
||||
if !should_ignore {
|
||||
acc.push(UnusedMut { local }.into())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue