Skip to content

Commit 3fa3647

Browse files
committed
Rename external_private_dependency to exported_private_dependencies
1 parent dfd2669 commit 3fa3647

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

src/librustc/lint/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ declare_lint! {
126126
}
127127

128128
declare_lint! {
129-
pub EXTERNAL_PRIVATE_DEPENDENCY,
129+
pub EXPORTED_PRIVATE_DEPENDENCIES,
130130
Warn,
131131
"public interface leaks type from a private dependency"
132132
}
@@ -411,7 +411,7 @@ impl LintPass for HardwiredLints {
411411
TRIVIAL_CASTS,
412412
TRIVIAL_NUMERIC_CASTS,
413413
PRIVATE_IN_PUBLIC,
414-
EXTERNAL_PRIVATE_DEPENDENCY,
414+
EXPORTED_PRIVATE_DEPENDENCIES,
415415
PUB_USE_OF_PRIVATE_EXTERN_CRATE,
416416
INVALID_TYPE_PARAM_DEFAULT,
417417
CONST_ERR,

src/librustc_lint/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
230230
edition: None,
231231
},
232232
FutureIncompatibleInfo {
233-
id: LintId::of(EXTERNAL_PRIVATE_DEPENDENCY),
233+
id: LintId::of(EXPORTED_PRIVATE_DEPENDENCIES),
234234
reference: "issue #44663 <https://github.com/rust-lang/rust/issues/44663>",
235235
edition: None,
236236
},

src/librustc_privacy/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ impl<'a, 'tcx: 'a> SearchInterfaceForPrivateItemsVisitor<'a, 'tcx> {
14961496

14971497
fn check_def_id(&mut self, def_id: DefId, kind: &str, descr: &dyn fmt::Display) -> bool {
14981498
if self.leaks_private_dep(def_id) {
1499-
self.tcx.lint_node(lint::builtin::EXTERNAL_PRIVATE_DEPENDENCY,
1499+
self.tcx.lint_node(lint::builtin::EXPORTED_PRIVATE_DEPENDENCIES,
15001500
self.item_id,
15011501
self.span,
15021502
&format!("{} `{}` from private dependency '{}' in public \
@@ -1726,9 +1726,6 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Lrc<AccessLevels> {
17261726
fn check_mod_privacy<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, module_def_id: DefId) {
17271727
let empty_tables = ty::TypeckTables::empty(None);
17281728

1729-
let public_crates: FxHashSet<CrateNum> = tcx.sess.opts.extern_public.iter().flat_map(|c| {
1730-
tcx.crates().iter().find(|&&krate| &tcx.crate_name(krate) == c).cloned()
1731-
}).collect();
17321729

17331730
// Check privacy of names not checked in previous compilation stages.
17341731
let mut visitor = NamePrivacyVisitor {
@@ -1765,6 +1762,11 @@ fn privacy_access_levels<'tcx>(
17651762
queries::check_mod_privacy::ensure(tcx, tcx.hir().local_def_id(module));
17661763
}
17671764

1765+
let public_crates: FxHashSet<CrateNum> = tcx.sess.opts.extern_public.iter().flat_map(|c| {
1766+
tcx.crates().iter().find(|&&krate| &tcx.crate_name(krate) == c).cloned()
1767+
}).collect();
1768+
1769+
17681770
// Build up a set of all exported items in the AST. This is a set of all
17691771
// items which are reachable from external crates based on visibility.
17701772
let mut visitor = EmbargoVisitor {

src/test/ui/feature-gates/feature-gate-public_private_dependencies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// Without ![feature(public_private_dependencies)],
1111
// this should do nothing/
12-
#![deny(external_private_dependency)]
12+
#![deny(exported_private_dependencies)]
1313

1414
extern crate pub_dep;
1515

src/test/ui/privacy/pub-priv-dep/pub-priv1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// aux-build:pub_dep.rs
33
// compile-flags: --extern-public=pub_dep
44
#![feature(public_private_dependencies)]
5-
#![deny(external_private_dependency)]
5+
#![deny(exported_private_dependencies)]
66

77
// This crate is a private dependency
88
extern crate priv_dep;

src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ LL | pub field: OtherType,
77
note: lint level defined here
88
--> $DIR/pub-priv1.rs:5:9
99
|
10-
LL | #![deny(external_private_dependency)]
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
10+
LL | #![deny(exported_private_dependencies)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1313
= note: for more information, see issue #44663 <https://github.com/rust-lang/rust/issues/44663>
1414

src/test/ui/privacy/pub-priv-dep/std-pub.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// run-pass
55

66
#![feature(public_private_dependencies)]
7-
#![deny(external_private_dependency)]
7+
#![deny(exported_private_dependencies)]
88

99
pub struct PublicType {
1010
pub field: Option<u8>

0 commit comments

Comments
 (0)