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:
parent
5a8a44196b
commit
93aa89023f
4 changed files with 11 additions and 7 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue