]> git.lizzy.rs Git - rust.git/commitdiff
Rename external_private_dependency to exported_private_dependencies
authorAaron Hill <aa1ronham@gmail.com>
Mon, 21 Jan 2019 03:04:22 +0000 (22:04 -0500)
committerAaron Hill <aa1ronham@gmail.com>
Fri, 1 Feb 2019 14:43:56 +0000 (09:43 -0500)
src/librustc/lint/builtin.rs
src/librustc_lint/lib.rs
src/librustc_privacy/lib.rs
src/test/ui/feature-gates/feature-gate-public_private_dependencies.rs
src/test/ui/privacy/pub-priv-dep/pub-priv1.rs
src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr
src/test/ui/privacy/pub-priv-dep/std-pub.rs

index 473214a04c8ed27e396f65636c95422fb070e403..3fe544d690640d62c0ffbaf9e12c07b58a9ee535 100644 (file)
 }
 
 declare_lint! {
-    pub EXTERNAL_PRIVATE_DEPENDENCY,
+    pub EXPORTED_PRIVATE_DEPENDENCIES,
     Warn,
     "public interface leaks type from a private dependency"
 }
@@ -411,7 +411,7 @@ fn get_lints(&self) -> LintArray {
             TRIVIAL_CASTS,
             TRIVIAL_NUMERIC_CASTS,
             PRIVATE_IN_PUBLIC,
-            EXTERNAL_PRIVATE_DEPENDENCY,
+            EXPORTED_PRIVATE_DEPENDENCIES,
             PUB_USE_OF_PRIVATE_EXTERN_CRATE,
             INVALID_TYPE_PARAM_DEFAULT,
             CONST_ERR,
index 66e6368e83da0a116e0e21cf94831c42f65dbe78..128bc70087f9484d0609702526598d78d37cc4e5 100644 (file)
@@ -230,7 +230,7 @@ macro_rules! register_passes {
             edition: None,
         },
         FutureIncompatibleInfo {
-            id: LintId::of(EXTERNAL_PRIVATE_DEPENDENCY),
+            id: LintId::of(EXPORTED_PRIVATE_DEPENDENCIES),
             reference: "issue #44663 <https://github.com/rust-lang/rust/issues/44663>",
             edition: None,
         },
index 6a91ec81e4e71201bf4c56ba100af9acd232a9ef..01694df1df106b3b4a8ac5189ff044c7d316a029 100644 (file)
@@ -1496,7 +1496,7 @@ fn ty(&mut self) -> &mut Self {
 
     fn check_def_id(&mut self, def_id: DefId, kind: &str, descr: &dyn fmt::Display) -> bool {
         if self.leaks_private_dep(def_id) {
-            self.tcx.lint_node(lint::builtin::EXTERNAL_PRIVATE_DEPENDENCY,
+            self.tcx.lint_node(lint::builtin::EXPORTED_PRIVATE_DEPENDENCIES,
                                self.item_id,
                                self.span,
                                &format!("{} `{}` from private dependency '{}' in public \
@@ -1726,9 +1726,6 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Lrc<AccessLevels> {
 fn check_mod_privacy<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, module_def_id: DefId) {
     let empty_tables = ty::TypeckTables::empty(None);
 
-    let public_crates: FxHashSet<CrateNum> = tcx.sess.opts.extern_public.iter().flat_map(|c| {
-        tcx.crates().iter().find(|&&krate| &tcx.crate_name(krate) == c).cloned()
-    }).collect();
 
     // Check privacy of names not checked in previous compilation stages.
     let mut visitor = NamePrivacyVisitor {
@@ -1765,6 +1762,11 @@ fn privacy_access_levels<'tcx>(
         queries::check_mod_privacy::ensure(tcx, tcx.hir().local_def_id(module));
     }
 
+    let public_crates: FxHashSet<CrateNum> = tcx.sess.opts.extern_public.iter().flat_map(|c| {
+        tcx.crates().iter().find(|&&krate| &tcx.crate_name(krate) == c).cloned()
+    }).collect();
+
+
     // Build up a set of all exported items in the AST. This is a set of all
     // items which are reachable from external crates based on visibility.
     let mut visitor = EmbargoVisitor {
index bd27c844fc620042ae902912fe8ccff9910e75ee..b8fb4b8dc19da8022dfad013f6b5654e137fa8ee 100644 (file)
@@ -9,7 +9,7 @@
 
 // Without ![feature(public_private_dependencies)],
 // this should do nothing/
-#![deny(external_private_dependency)]
+#![deny(exported_private_dependencies)]
 
 extern crate pub_dep;
 
index 16a59dff8780ec44fb1b2dcbba9fec4ff5a952e4..7d71dbe6392d424947b745ad9d0d24cc6627fc77 100644 (file)
@@ -2,7 +2,7 @@
  // aux-build:pub_dep.rs
  // compile-flags: --extern-public=pub_dep
 #![feature(public_private_dependencies)]
-#![deny(external_private_dependency)]
+#![deny(exported_private_dependencies)]
 
 // This crate is a private dependency
 extern crate priv_dep;
index 9e5bffa6eea3e24bfec543d28ffcdc470618d2ab..11f4be8cbbc129eabf43cc94b5db443660257219 100644 (file)
@@ -7,8 +7,8 @@ LL |     pub field: OtherType,
 note: lint level defined here
   --> $DIR/pub-priv1.rs:5:9
    |
-LL | #![deny(external_private_dependency)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #![deny(exported_private_dependencies)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #44663 <https://github.com/rust-lang/rust/issues/44663>
 
index 7acf0f89c5dbe3211c77b21c5b560c2b851192c5..3c1520c69027dd5a3ed45122f9c0b4bf8708ce58 100644 (file)
@@ -4,7 +4,7 @@
 // run-pass
 
 #![feature(public_private_dependencies)]
-#![deny(external_private_dependency)]
+#![deny(exported_private_dependencies)]
 
 pub struct PublicType {
     pub field: Option<u8>