mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
fix: Resolve private fields in type inference
This commit is contained in:
parent
de0941301e
commit
41b6b372a7
2 changed files with 17 additions and 1 deletions
|
@ -532,6 +532,11 @@ impl<'a> InferenceContext<'a> {
|
|||
.substitute(Interner, ¶meters),
|
||||
)
|
||||
} else {
|
||||
// Write down the first field resolution even if it is not visible
|
||||
// This aids IDE features for private fields like goto def and in
|
||||
// case of autoderef finding an applicable field, this will be
|
||||
// overwritten in a following cycle
|
||||
self.write_field_resolution_if_empty(tgt_expr, field);
|
||||
None
|
||||
}
|
||||
}
|
||||
|
@ -546,6 +551,11 @@ impl<'a> InferenceContext<'a> {
|
|||
.substitute(Interner, ¶meters),
|
||||
)
|
||||
} else {
|
||||
// Write down the first field resolution even if it is not visible
|
||||
// This aids IDE features for private fields like goto def and in
|
||||
// case of autoderef finding an applicable field, this will be
|
||||
// overwritten in a following cycle
|
||||
self.write_field_resolution_if_empty(tgt_expr, field);
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue