@@ -134,24 +134,21 @@ impl<'ra> EarlyDocLinkResolver<'_, 'ra> {
134
134
// using privacy, private traits and impls from other crates are never documented in
135
135
// the current crate, and links in their doc comments are not resolved.
136
136
for & def_id in & all_traits {
137
- if self . resolver . cstore ( ) . visibility_untracked ( def_id) == Visibility :: Public {
137
+ if self . resolver . cstore ( ) . visibility_untracked ( def_id) . is_public ( ) {
138
138
self . resolve_doc_links_extern_impl ( def_id, false ) ;
139
139
}
140
140
}
141
141
for & ( trait_def_id, impl_def_id, simplified_self_ty) in & all_trait_impls {
142
- if self . resolver . cstore ( ) . visibility_untracked ( trait_def_id)
143
- == Visibility :: Public
142
+ if self . resolver . cstore ( ) . visibility_untracked ( trait_def_id) . is_public ( )
144
143
&& simplified_self_ty. and_then ( |ty| ty. def ( ) ) . map_or ( true , |ty_def_id| {
145
- self . resolver . cstore ( ) . visibility_untracked ( ty_def_id)
146
- == Visibility :: Public
144
+ self . resolver . cstore ( ) . visibility_untracked ( ty_def_id) . is_public ( )
147
145
} )
148
146
{
149
147
self . resolve_doc_links_extern_impl ( impl_def_id, false ) ;
150
148
}
151
149
}
152
150
for ( ty_def_id, impl_def_id) in all_inherent_impls {
153
- if self . resolver . cstore ( ) . visibility_untracked ( ty_def_id) == Visibility :: Public
154
- {
151
+ if self . resolver . cstore ( ) . visibility_untracked ( ty_def_id) . is_public ( ) {
155
152
self . resolve_doc_links_extern_impl ( impl_def_id, true ) ;
156
153
}
157
154
}
@@ -178,8 +175,7 @@ impl<'ra> EarlyDocLinkResolver<'_, 'ra> {
178
175
self . resolver . cstore ( ) . associated_item_def_ids_untracked ( def_id, self . sess ) ,
179
176
) ;
180
177
for assoc_def_id in assoc_item_def_ids {
181
- if !is_inherent
182
- || self . resolver . cstore ( ) . visibility_untracked ( assoc_def_id) == Visibility :: Public
178
+ if !is_inherent || self . resolver . cstore ( ) . visibility_untracked ( assoc_def_id) . is_public ( )
183
179
{
184
180
self . resolve_doc_links_extern_outer ( assoc_def_id, def_id) ;
185
181
}
@@ -279,7 +275,7 @@ impl<'ra> EarlyDocLinkResolver<'_, 'ra> {
279
275
280
276
for child in self . resolver . module_children_or_reexports ( module_id) {
281
277
// This condition should give a superset of `denied` from `fn clean_use_statement`.
282
- if child. vis == Visibility :: Public
278
+ if child. vis . is_public ( )
283
279
|| self . document_private_items
284
280
&& child. vis != Visibility :: Restricted ( module_id)
285
281
&& module_id. is_local ( )
0 commit comments