Skip to content

Commit d5c0f4d

Browse files
committed
Sync the logic for inherent and weak type aliases
1 parent 9088ba9 commit d5c0f4d

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ where
210210
}
211211
}
212212
}
213-
ty::Alias(ty::Weak, alias) => {
214-
self.def_id_visitor.visit_def_id(alias.def_id, "type alias", &ty);
215-
}
216213
ty::Alias(ty::Projection, proj) => {
217214
if V::SKIP_ASSOC_TYS {
218215
// Visitors searching for minimal visibility/reachability want to
@@ -225,7 +222,7 @@ where
225222
// This will also visit args if necessary, so we don't need to recurse.
226223
return self.visit_projection_ty(proj);
227224
}
228-
ty::Alias(ty::Inherent, data) => {
225+
ty::Alias(kind @ (ty::Inherent | ty::Weak), data) => {
229226
if V::SKIP_ASSOC_TYS {
230227
// Visitors searching for minimal visibility/reachability want to
231228
// conservatively approximate associated types like `Type::Alias`
@@ -237,7 +234,11 @@ where
237234

238235
self.def_id_visitor.visit_def_id(
239236
data.def_id,
240-
"associated type",
237+
match kind {
238+
ty::Inherent => "associated type",
239+
ty::Weak => "type alias",
240+
_ => unreachable!(),
241+
},
241242
&LazyDefPathStr { def_id: data.def_id, tcx },
242243
)?;
243244

0 commit comments

Comments
 (0)