1
Fork 0

Store the laziness of type aliases in the DefKind

This commit is contained in:
León Orell Valerian Liehr 2023-08-06 23:02:27 +02:00
parent 34ccd04859
commit 5468336d6b
No known key found for this signature in database
GPG key ID: D17A07215F68E713
49 changed files with 208 additions and 93 deletions

View file

@ -583,7 +583,7 @@ impl<'tcx> EmbargoVisitor<'tcx> {
self.update(def_id, macro_ev, Level::Reachable);
match def_kind {
// No type privacy, so can be directly marked as reachable.
DefKind::Const | DefKind::Static(_) | DefKind::TraitAlias | DefKind::TyAlias => {
DefKind::Const | DefKind::Static(_) | DefKind::TraitAlias | DefKind::TyAlias { .. } => {
if vis.is_accessible_from(module, self.tcx) {
self.update(def_id, macro_ev, Level::Reachable);
}
@ -1992,8 +1992,8 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'tcx, '_> {
let def_kind = tcx.def_kind(def_id);
match def_kind {
DefKind::Const | DefKind::Static(_) | DefKind::Fn | DefKind::TyAlias => {
if let DefKind::TyAlias = def_kind {
DefKind::Const | DefKind::Static(_) | DefKind::Fn | DefKind::TyAlias { .. } => {
if let DefKind::TyAlias { .. } = def_kind {
self.check_unnameable(def_id, effective_vis);
}
self.check(def_id, item_visibility, effective_vis).generics().predicates().ty();