Skip to content

Commit 1448103

Browse files
committed
Sync the logic for inherent and weak type aliases
1 parent badaced commit 1448103

File tree

1 file changed

+6
-5
lines changed
  • compiler/rustc_privacy/src

1 file changed

+6
-5
lines changed

compiler/rustc_privacy/src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,6 @@ where
207207
}
208208
}
209209
}
210-
ty::Alias(ty::Weak, alias) => {
211-
self.def_id_visitor.visit_def_id(alias.def_id, "type alias", &ty);
212-
}
213210
ty::Alias(ty::Projection, proj) => {
214211
if V::SKIP_ASSOC_TYS {
215212
// Visitors searching for minimal visibility/reachability want to
@@ -222,7 +219,7 @@ where
222219
// This will also visit args if necessary, so we don't need to recurse.
223220
return self.visit_projection_ty(proj);
224221
}
225-
ty::Alias(ty::Inherent, data) => {
222+
ty::Alias(kind @ (ty::Inherent | ty::Weak), data) => {
226223
if V::SKIP_ASSOC_TYS {
227224
// Visitors searching for minimal visibility/reachability want to
228225
// conservatively approximate associated types like `Type::Alias`
@@ -234,7 +231,11 @@ where
234231

235232
self.def_id_visitor.visit_def_id(
236233
data.def_id,
237-
"associated type",
234+
match kind {
235+
ty::Inherent => "associated type",
236+
ty::Weak => "type alias",
237+
_ => unreachable!(),
238+
},
238239
&LazyDefPathStr { def_id: data.def_id, tcx },
239240
)?;
240241

0 commit comments

Comments
 (0)