add unresolved-assoc-item diagnostic

This commit is contained in:
Rose Hudson 2023-12-31 17:33:36 +00:00
parent cf52c4b2b3
commit 5878651e7e
6 changed files with 74 additions and 1 deletions

View file

@ -1695,6 +1695,13 @@ impl DefWithBody {
.into(),
)
}
&hir_ty::InferenceDiagnostic::UnresolvedAssocItem { id } => {
let expr_or_pat = match id {
ExprOrPatId::ExprId(expr) => expr_syntax(expr).map(AstPtr::wrap_left),
ExprOrPatId::PatId(pat) => pat_syntax(pat).map(AstPtr::wrap_right),
};
acc.push(UnresolvedAssocItem { expr_or_pat }.into())
}
&hir_ty::InferenceDiagnostic::BreakOutsideOfLoop {
expr,
is_break,