@@ -79,7 +79,7 @@ The dependencies `serde` and `serde_json` are both public dependencies, meaning
79
79
This has the implication that a semver incompatible upgrade of these dependencies is a breaking change for this package.
80
80
81
81
With 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
83
83
manifest and rustc will warn saying that ` serde ` and ` serde_json ` are private
84
84
dependencies in a public API.
85
85
In 2024+ editions, this will be an error.
@@ -145,7 +145,7 @@ Since the proc-macro can only guarantee that the namespace `clap` is accessible,
145
145
As a last-ditch way of dealing with this, a user may allow the error:
146
146
``` rust
147
147
#[doc(hidden)]
148
- #[allow(external_private_dependency )]
148
+ #[allow(exported_private_dependencies )]
149
149
#[cfg(feature = " derive" )]
150
150
pub mod __derive_refs {
151
151
#[doc(hidden)]
@@ -155,7 +155,7 @@ pub mod __derive_refs {
155
155
A similar case is pub-in-private:
156
156
``` rust
157
157
mod private {
158
- #[allow(external_private_dependency )]
158
+ #[allow(exported_private_dependencies )]
159
159
pub struct Foo { pub x : some_dependency :: SomeType }
160
160
}
161
161
```
@@ -173,16 +173,16 @@ features like `impl Trait` in type aliases if we had it.
173
173
The main change to the compiler will be to accept a new modifier on the ` --extern ` flag that Cargo
174
174
supplies which marks it as a private dependency.
175
175
The 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
177
177
dependencies exposed as ` public ` .
178
178
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.
180
180
It will be a member of the ` rust-2024-compatibility ` lint group so that it gets automatically picked up by ` cargo fix --edition ` .
181
181
In the 2024 edition, this lint will be ` deny ` .
182
182
183
183
In some situations, it can be necessary to allow private dependencies to become
184
184
part 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
186
186
paired with ` #[doc(hidden)] ` and other already existing hacks.
187
187
This most likely will also be necessary for the more complex relationship of
188
188
` libcore ` and ` libstd ` in Rust itself.
0 commit comments