Skip to content

rustdoc shows a non-public path for rustc_target::callconv::PassMode #137209

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

Open
RalfJung opened this issue Feb 18, 2025 · 4 comments
Open

rustdoc shows a non-public path for rustc_target::callconv::PassMode #137209

RalfJung opened this issue Feb 18, 2025 · 4 comments
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate A-rustdoc-search Area: Rustdoc's search feature C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@RalfJung
Copy link
Member

To reproduce, visit https://doc.rust-lang.org/nightly/nightly-rustc/?search=PassMode. The main PassMode type used all over the compiler is shown as rustc_codegen_llvm::abi::PassMode. That is quite misleading since it makes it look like the type is specific to the LLVM codegen backend, when it is not! rustdoc should instead pick the path in rustc_target and show that.

It seems to me this changed recently. I am fairly sure I searched for PassMode before and it never used rustc_codegen_llvm as the canonical path. Not sure if it is rustdoc that changed or the rustc crate organization.

Cc @rust-lang/rustdoc @workingjubilee

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 18, 2025
@workingjubilee workingjubilee added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-rustdoc-search Area: Rustdoc's search feature labels Feb 18, 2025
@rustbot rustbot added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Feb 18, 2025
@workingjubilee
Copy link
Member

I don't think any of my changes were the cause of this, and it seems to be fixed if I remove the reexport.

@RalfJung RalfJung changed the title rustdoc chooses an odd canonical path for rustc_target::callconv::PassMode rustdoc shows a non-public path for rustc_target::callconv::PassMode Feb 18, 2025
@RalfJung
Copy link
Member Author

RalfJung commented Feb 18, 2025

Turns out that path rustdoc shows is not even public! It's pub(crate). So this seems like a quite severe rutsdoc bug.

pub(crate) use rustc_target::callconv::*;

@aDotInTheVoid aDotInTheVoid added E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Feb 18, 2025
@fmease
Copy link
Member

fmease commented Feb 18, 2025

(bootstrap passes --document-private-items, so not quite as severe; but definitely not ideal)

@RalfJung
Copy link
Member Author

Ah, fair.

But such a private path should still never trump a public path in search.

@aDotInTheVoid aDotInTheVoid added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate A-rustdoc-search Area: Rustdoc's search feature C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

No branches or pull requests

5 participants