Skip to content

Commit

Permalink
Rename check_privacy to check_private_in_public
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 6, 2019
1 parent db9a1c1 commit 7985c6f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/librustc/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ define_dep_nodes!( <'tcx>
[eval_always] CoherenceInherentImplOverlapCheck,
[] CoherenceCheckTrait(DefId),
[eval_always] PrivacyAccessLevels(CrateNum),
[eval_always] CheckPrivacy(CrateNum),
[eval_always] CheckPrivateInPublic(CrateNum),
[eval_always] Analysis(CrateNum),

// Represents the MIR for a fn; also used as the task node for
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/ty/query/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ impl<'tcx> QueryDescription<'tcx> for queries::privacy_access_levels<'tcx> {
}
}

impl<'tcx> QueryDescription<'tcx> for queries::check_privacy<'tcx> {
impl<'tcx> QueryDescription<'tcx> for queries::check_private_in_public<'tcx> {
fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> {
"privacy checking".into()
"checking for private elements in public interfaces".into()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ define_queries! { <'tcx>

/// Performs part of the privacy check and computes "access levels".
[] fn privacy_access_levels: PrivacyAccessLevels(CrateNum) -> Lrc<AccessLevels>,
[] fn check_privacy: CheckPrivacy(CrateNum) -> (),
[] fn check_private_in_public: CheckPrivateInPublic(CrateNum) -> (),
},

Other {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>,
force!(crate_inherent_impls_overlap_check, LOCAL_CRATE)
},
DepKind::PrivacyAccessLevels => { force!(privacy_access_levels, LOCAL_CRATE); }
DepKind::CheckPrivacy => { force!(check_privacy, LOCAL_CRATE); }
DepKind::CheckPrivateInPublic => { force!(check_private_in_public, LOCAL_CRATE); }
DepKind::MirBuilt => { force!(mir_built, def_id!()); }
DepKind::MirConstQualif => { force!(mir_const_qualif, def_id!()); }
DepKind::MirConst => { force!(mir_const, def_id!()); }
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_interface/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ fn analysis<'tcx>(
tcx.ensure().privacy_access_levels(LOCAL_CRATE);
});
parallel!({
time(sess, "privacy checking", || {
tcx.ensure().check_privacy(LOCAL_CRATE);
time(sess, "private in public", || {
tcx.ensure().check_private_in_public(LOCAL_CRATE);
});
}, {
time(sess, "death checking", || middle::dead::check_crate(tcx));
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_privacy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ impl<'a, 'tcx> Visitor<'tcx> for PrivateItemsInPublicInterfacesVisitor<'a, 'tcx>
pub fn provide(providers: &mut Providers<'_>) {
*providers = Providers {
privacy_access_levels,
check_privacy,
check_private_in_public,
check_mod_privacy,
..*providers
};
Expand Down Expand Up @@ -1820,7 +1820,7 @@ fn privacy_access_levels<'tcx>(
Lrc::new(visitor.access_levels)
}

fn check_privacy<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, krate: CrateNum) {
fn check_private_in_public<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, krate: CrateNum) {
assert_eq!(krate, LOCAL_CRATE);

let access_levels = tcx.privacy_access_levels(LOCAL_CRATE);
Expand Down

0 comments on commit 7985c6f

Please sign in to comment.