mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Skip mutable diagnostics on synthetic bindings
This commit is contained in:
parent
6d333e587d
commit
d8b970f1fc
2 changed files with 21 additions and 0 deletions
|
@ -1661,6 +1661,14 @@ impl DefWithBody {
|
|||
let Some(&local) = mir_body.binding_locals.get(binding_id) else {
|
||||
continue;
|
||||
};
|
||||
if body[binding_id]
|
||||
.definitions
|
||||
.iter()
|
||||
.any(|&pat| source_map.pat_syntax(pat).is_err())
|
||||
{
|
||||
// Skip synthetic bindings
|
||||
continue;
|
||||
}
|
||||
let need_mut = &mol[local];
|
||||
let local = Local { parent: self.into(), binding_id };
|
||||
match (need_mut, local.is_mut(db)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue