@@ -79,7 +79,7 @@ The dependencies `serde` and `serde_json` are both public dependencies, meaning
7979This has the implication that a semver incompatible upgrade of these dependencies is a breaking change for this package.
8080
8181With this RFC, in pre-2024 editions,
82- you can enable add ` lints.rust.external_private_dependency = "warn" ` to your
82+ you can enable add ` lints.rust.exported_private_dependencies = "warn" ` to your
8383manifest and rustc will warn saying that ` serde ` and ` serde_json ` are private
8484dependencies in a public API.
8585In 2024+ editions, this will be an error.
@@ -145,7 +145,7 @@ Since the proc-macro can only guarantee that the namespace `clap` is accessible,
145145As a last-ditch way of dealing with this, a user may allow the error:
146146``` rust
147147#[doc(hidden)]
148- #[allow(external_private_dependency )]
148+ #[allow(exported_private_dependencies )]
149149#[cfg(feature = " derive" )]
150150pub mod __derive_refs {
151151 #[doc(hidden)]
@@ -155,7 +155,7 @@ pub mod __derive_refs {
155155A similar case is pub-in-private:
156156``` rust
157157mod private {
158- #[allow(external_private_dependency )]
158+ #[allow(exported_private_dependencies )]
159159 pub struct Foo { pub x : some_dependency :: SomeType }
160160}
161161```
@@ -173,16 +173,16 @@ features like `impl Trait` in type aliases if we had it.
173173The main change to the compiler will be to accept a new modifier on the ` --extern ` flag that Cargo
174174supplies which marks it as a private dependency.
175175The modifier will be called ` priv ` (e.g. ` --extern priv:serde ` ).
176- The compiler then emits the lint ` external_private_dependency ` if it encounters private
176+ The compiler then emits the lint ` exported-private-dependencies ` if it encounters private
177177dependencies exposed as ` public ` .
178178
179- ` external_private_dependency ` will be ` allow ` by default for pre-2024 editions.
179+ ` exported-private-dependencies ` will be ` allow ` by default for pre-2024 editions.
180180It will be a member of the ` rust-2024-compatibility ` lint group so that it gets automatically picked up by ` cargo fix --edition ` .
181181In the 2024 edition, this lint will be ` deny ` .
182182
183183In some situations, it can be necessary to allow private dependencies to become
184184part of the public API. In that case one can permit this with
185- ` #[allow(external_private_dependency )] ` . This is particularly useful when
185+ ` #[allow(exported_private_dependencies )] ` . This is particularly useful when
186186paired with ` #[doc(hidden)] ` and other already existing hacks.
187187This most likely will also be necessary for the more complex relationship of
188188` libcore ` and ` libstd ` in Rust itself.
0 commit comments