Store associated item defaultness in impl_defaultness.

This commit is contained in:
Camille GILLOT 2022-03-12 19:36:11 +01:00
parent c9e134e1b6
commit 110f0656cb
25 changed files with 89 additions and 107 deletions

View file

@ -1988,7 +1988,7 @@ fn confirm_impl_candidate<'cx, 'tcx>(
return Progress { term: tcx.ty_error().into(), obligations: nested };
};
if !assoc_ty.item.defaultness.has_value() {
if !assoc_ty.item.defaultness(tcx).has_value() {
// This means that the impl is missing a definition for the
// associated type. This error will be reported by the type
// checker method `check_impl_items_against_trait`, so here we
@ -2089,7 +2089,11 @@ fn assoc_def(
return Ok(specialization_graph::LeafDef {
item: *item,
defining_node: impl_node,
finalizing_node: if item.defaultness.is_default() { None } else { Some(impl_node) },
finalizing_node: if item.defaultness(tcx).is_default() {
None
} else {
Some(impl_node)
},
});
}