1
Fork 0

Extend HIR-based WF checking to associated type defaults

Previously, we would only look at associated types in `impl` blocks.
This commit is contained in:
Aaron Hill 2021-07-18 10:36:07 -05:00
parent 5a8a44196b
commit 93aa89023f
No known key found for this signature in database
GPG key ID: B4087E510E98B164
4 changed files with 11 additions and 7 deletions

View file

@ -121,7 +121,11 @@ fn diagnostic_hir_wf_check<'tcx>(
let ty = match tcx.hir().get(hir_id) {
hir::Node::ImplItem(item) => match item.kind {
hir::ImplItemKind::TyAlias(ref ty) => Some(ty),
hir::ImplItemKind::TyAlias(ty) => Some(ty),
_ => None,
},
hir::Node::TraitItem(item) => match item.kind {
hir::TraitItemKind::Type(_, ty) => ty,
_ => None,
},
_ => None,