Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make pub_use_of_private_extern_crate show up in cargo's future breakage reports #127656

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,16 +1203,16 @@ declare_lint! {
/// This was historically allowed, but is not the intended behavior
/// according to the visibility rules. This is a [future-incompatible]
/// lint to transition this to a hard error in the future. See [issue
/// #34537] for more details.
/// #127909] for more details.
///
/// [issue #34537]: https://github.com/rust-lang/rust/issues/34537
/// [issue #127909]: https://github.com/rust-lang/rust/issues/127909
/// [future-incompatible]: ../index.md#future-incompatible-lints
pub PUB_USE_OF_PRIVATE_EXTERN_CRATE,
Deny,
"detect public re-exports of private extern crates",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reference: "issue #34537 <https://github.com/rust-lang/rust/issues/34537>",
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reference: "issue #127909 <https://github.com/rust-lang/rust/issues/127909>",
};
}

Expand Down
17 changes: 16 additions & 1 deletion tests/ui/pub/pub-reexport-priv-extern-crate.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LL | pub use core as reexported_core;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= 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 #34537 <https://github.com/rust-lang/rust/issues/34537>
= note: for more information, see issue #127909 <https://github.com/rust-lang/rust/issues/127909>
= note: `#[deny(pub_use_of_private_extern_crate)]` on by default
help: consider making the `extern crate` item publicly accessible
|
Expand All @@ -40,3 +40,18 @@ error: aborting due to 3 previous errors

Some errors have detailed explanations: E0365, E0603.
For more information about an error, try `rustc --explain E0365`.
Future incompatibility report: Future breakage diagnostic:
error[E0365]: extern crate `core` is private and cannot be re-exported
--> $DIR/pub-reexport-priv-extern-crate.rs:2:9
|
LL | pub use core as reexported_core;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= 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 #127909 <https://github.com/rust-lang/rust/issues/127909>
= note: `#[deny(pub_use_of_private_extern_crate)]` on by default
help: consider making the `extern crate` item publicly accessible
|
LL | pub extern crate core;
| +++

Loading