Store associated item defaultness in impl_defaultness.
This commit is contained in:
parent
c9e134e1b6
commit
110f0656cb
25 changed files with 89 additions and 107 deletions
|
@ -734,11 +734,12 @@ impl<'tcx> Visitor<'tcx> for EmbargoVisitor<'tcx> {
|
|||
self.reach(item.def_id, item_level).generics().predicates();
|
||||
|
||||
for trait_item_ref in trait_item_refs {
|
||||
let tcx = self.tcx;
|
||||
let mut reach = self.reach(trait_item_ref.id.def_id, item_level);
|
||||
reach.generics().predicates();
|
||||
|
||||
if trait_item_ref.kind == AssocItemKind::Type
|
||||
&& !trait_item_ref.defaultness.has_value()
|
||||
&& !tcx.impl_defaultness(trait_item_ref.id.def_id).has_value()
|
||||
{
|
||||
// No type to visit.
|
||||
} else {
|
||||
|
@ -1839,14 +1840,13 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'tcx> {
|
|||
&self,
|
||||
def_id: LocalDefId,
|
||||
assoc_item_kind: AssocItemKind,
|
||||
defaultness: hir::Defaultness,
|
||||
vis: ty::Visibility,
|
||||
) {
|
||||
let mut check = self.check(def_id, vis);
|
||||
|
||||
let (check_ty, is_assoc_ty) = match assoc_item_kind {
|
||||
AssocItemKind::Const | AssocItemKind::Fn { .. } => (true, false),
|
||||
AssocItemKind::Type => (defaultness.has_value(), true),
|
||||
AssocItemKind::Type => (self.tcx.impl_defaultness(def_id).has_value(), true),
|
||||
};
|
||||
check.in_assoc_ty = is_assoc_ty;
|
||||
check.generics().predicates();
|
||||
|
@ -1878,7 +1878,6 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'tcx> {
|
|||
self.check_assoc_item(
|
||||
trait_item_ref.id.def_id,
|
||||
trait_item_ref.kind,
|
||||
trait_item_ref.defaultness,
|
||||
item_visibility,
|
||||
);
|
||||
|
||||
|
@ -1951,7 +1950,6 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'tcx> {
|
|||
self.check_assoc_item(
|
||||
impl_item_ref.id.def_id,
|
||||
impl_item_ref.kind,
|
||||
impl_item_ref.defaultness,
|
||||
impl_item_vis,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue