diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-09-08 11:55:09 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-08 11:55:09 +0530 |
| commit | 12b810063dc87bc985e8aab8d0fa2179add2610f (patch) | |
| tree | 8ee6fd5e03e2d2913a9c70baa1c4f7d395e78d3e /src/librustdoc | |
| parent | 1c3559676265f2c320f4e361fece080b0f464f97 (diff) | |
| parent | d8d3b83e3ae6ade8498862d8c110c302abf859d9 (diff) | |
Rollup merge of #101498 - petrochenkov:visparam, r=cjgillot
rustc: Parameterize `ty::Visibility` over used ID It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 980a1485b59..c2baea839f6 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1777,7 +1777,7 @@ fn is_field_vis_inherited(tcx: TyCtxt<'_>, def_id: DefId) -> bool { } } -pub(crate) fn clean_visibility(vis: ty::Visibility) -> Visibility { +pub(crate) fn clean_visibility(vis: ty::Visibility<DefId>) -> Visibility { match vis { ty::Visibility::Public => Visibility::Public, ty::Visibility::Restricted(module) => Visibility::Restricted(module), @@ -2111,8 +2111,8 @@ fn clean_use_statement<'tcx>( // `pub(super)` or higher. If the current module is the top level // module, there isn't really a parent module, which makes the results // meaningless. In this case, we make sure the answer is `false`. - let is_visible_from_parent_mod = visibility.is_accessible_from(parent_mod.to_def_id(), cx.tcx) - && !current_mod.is_top_level_module(); + let is_visible_from_parent_mod = + visibility.is_accessible_from(parent_mod, cx.tcx) && !current_mod.is_top_level_module(); if pub_underscore { if let Some(ref inline) = inline_attr { |
