Auto merge of #16222 - rosefromthedead:unresolved-assoc-item, r=Veykril

add unresolved-assoc-item assist

I tried to copy from private-assoc-item for this
This commit is contained in:
bors 2024-01-02 15:06:13 +00:00
commit 426d2842c1
6 changed files with 74 additions and 1 deletions

View file

@ -219,6 +219,9 @@ pub enum InferenceDiagnostic {
field_with_same_name: Option<Ty>,
assoc_func_with_same_name: Option<AssocItemId>,
},
UnresolvedAssocItem {
id: ExprOrPatId,
},
// FIXME: This should be emitted in body lowering
BreakOutsideOfLoop {
expr: ExprId,

View file

@ -340,6 +340,9 @@ impl InferenceContext<'_> {
},
);
let res = res.or(not_visible);
if res.is_none() {
self.push_diagnostic(InferenceDiagnostic::UnresolvedAssocItem { id });
}
let (item, visible) = res?;
let (def, container) = match item {