1
Fork 0

Rollup merge of #87256 - Aaron1011:hir-wf-assoc-default, r=oli-obk

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:
Guillaume Gomez 2021-07-19 11:37:47 +02:00 committed by GitHub
commit 4dd32a1cac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,