Skip to content
Permalink
Browse files

Rename check_privacy to check_private_in_public

  • Loading branch information...
Zoxc committed Mar 6, 2019
1 parent db9a1c1 commit 7985c6f8ecf680dcc960bb2ccc0c787274a449de
@@ -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
@@ -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()
}
}

@@ -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 {
@@ -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!()); }
@@ -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));
@@ -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
};
@@ -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);

0 comments on commit 7985c6f

Please sign in to comment.
You can’t perform that action at this time.