Skip to content

Commit 34eb73c

Browse files
committedOct 26, 2022
privacy: Rename "accessibility levels" to "effective visibilities"
And a couple of other naming tweaks Related to #48054
1 parent 629a414 commit 34eb73c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+524
-516
lines changed
 

‎compiler/rustc_interface/src/passes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
927927
sess.time("misc_checking_3", || {
928928
parallel!(
929929
{
930-
tcx.ensure().privacy_access_levels(());
930+
tcx.ensure().effective_visibilities(());
931931

932932
parallel!(
933933
{

‎compiler/rustc_lint/src/builtin.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ impl MissingDoc {
563563
// It's an option so the crate root can also use this function (it doesn't
564564
// have a `NodeId`).
565565
if def_id != CRATE_DEF_ID {
566-
if !cx.access_levels.is_exported(def_id) {
566+
if !cx.effective_visibilities.is_exported(def_id) {
567567
return;
568568
}
569569
}
@@ -721,7 +721,7 @@ declare_lint_pass!(MissingCopyImplementations => [MISSING_COPY_IMPLEMENTATIONS])
721721

722722
impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
723723
fn check_item(&mut self, cx: &LateContext<'_>, item: &hir::Item<'_>) {
724-
if !cx.access_levels.is_reachable(item.def_id.def_id) {
724+
if !cx.effective_visibilities.is_reachable(item.def_id.def_id) {
725725
return;
726726
}
727727
let (def, ty) = match item.kind {
@@ -814,7 +814,7 @@ impl_lint_pass!(MissingDebugImplementations => [MISSING_DEBUG_IMPLEMENTATIONS]);
814814

815815
impl<'tcx> LateLintPass<'tcx> for MissingDebugImplementations {
816816
fn check_item(&mut self, cx: &LateContext<'_>, item: &hir::Item<'_>) {
817-
if !cx.access_levels.is_reachable(item.def_id.def_id) {
817+
if !cx.effective_visibilities.is_reachable(item.def_id.def_id) {
818818
return;
819819
}
820820

@@ -1385,7 +1385,8 @@ impl UnreachablePub {
13851385
exportable: bool,
13861386
) {
13871387
let mut applicability = Applicability::MachineApplicable;
1388-
if cx.tcx.visibility(def_id).is_public() && !cx.access_levels.is_reachable(def_id) {
1388+
if cx.tcx.visibility(def_id).is_public() && !cx.effective_visibilities.is_reachable(def_id)
1389+
{
13891390
if vis_span.from_expansion() {
13901391
applicability = Applicability::MaybeIncorrect;
13911392
}

0 commit comments

Comments
 (0)