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

Fix unreachable_pub lint for hermit target #136595

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thaliaarchi
Copy link
Contributor

The build for the hermit target (#[cfg(target_os = "hermit")]) fails on master as of 8df89d1cb07 (2025-02-05), due to introducing #[warn(unreachable_pub)] at the root in #134286 (Enable unreachable_pub lint in core, merged 2025-01-20).

Make the relevant visibility modifiers more specific to resolve the warning.

$ ./x build --target x86_64-unknown-hermit
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.34s
Building stage0 library artifacts (x86_64-apple-darwin)
    Finished `release` profile [optimized] target(s) in 0.15s
Building compiler artifacts (stage0 -> stage1, x86_64-apple-darwin)
    Finished `release` profile [optimized] target(s) in 1.67s
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Building stage1 library artifacts {alloc, core, panic_abort, panic_unwind, proc_macro, std, sysroot, test, unwind} (x86_64-apple-darwin -> x86_64-unknown-hermit)
   Compiling panic_unwind v0.0.0 (library/panic_unwind)
error: unreachable `pub` item
  --> library/panic_unwind/src/hermit.rs:10:9
   |
10 |         pub fn __rust_abort() -> !;
   |         ---^^^^^^^^^^^^^^^^^^^^^^^^
   |         |
   |         help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates
   = note: `-D unreachable-pub` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unreachable_pub)]`

error: unreachable `pub` item
  --> library/panic_unwind/src/hermit.rs:17:9
   |
17 |         pub fn __rust_abort() -> !;
   |         ---^^^^^^^^^^^^^^^^^^^^^^^^
   |         |
   |         help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates

error: could not compile `panic_unwind` (lib) due to 2 previous errors
Build completed unsuccessfully in 0:00:39

@rustbot
Copy link
Collaborator

rustbot commented Feb 5, 2025

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 5, 2025
@thaliaarchi
Copy link
Contributor Author

thaliaarchi commented Feb 5, 2025

r? @Noratrieb, since you helped triage it

@rustbot rustbot assigned Noratrieb and unassigned joboet Feb 5, 2025
@Noratrieb
Copy link
Member

@bors r+ rollup thanks!

@bors
Copy link
Contributor

bors commented Feb 5, 2025

📌 Commit 5794952 has been approved by Noratrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants