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

404 link in std docs #29584

Closed
benw opened this issue Nov 4, 2015 · 7 comments · Fixed by #31903
Closed

404 link in std docs #29584

benw opened this issue Nov 4, 2015 · 7 comments · Fixed by #31903
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@benw
Copy link

benw commented Nov 4, 2015

The link to "FullOps" on this page is broken: https://doc.rust-lang.org/std/primitive.u32.html

@hanna-kruppe
Copy link
Contributor

Background for anyone who wants to tackle this:

  • FullOps is an unstable trait defined in a doc(hidden) module of core (specifically in core::num::bignum). It is an implementation detail that should not leak out.
  • Because of the above, the fix is to not list the trait on the implementing type's page, not to generate a doc page for FullOps.
  • Other examples of such traits are RawFloat and DecodableFloat on f32 and f64, which are also listed on the respective pages with dead links.

@steveklabnik steveklabnik added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed A-docs labels Jan 7, 2016
@cdvv7788
Copy link

I want to give it a try, however i don't know what is the right way to test changes. How can i build only the related docs?
Make docs rebuilds everything, so it takes a while (even with the flag). How can i quickly test the html output for the docs without rebuilding everything?
I tried rustdoc 'path/to/file' too, but it is not able to compile the doc for that given file

@steveklabnik
Copy link
Member

How can i quickly test the html output for the docs without rebuilding everything?

Unfortunately, this kind of change is just going to take forever to test. :/

I tried rustdoc 'path/to/file' too, but it is not able to compile the doc for that given file

You have to point it at a crate root, not just any rust file.

@cdvv7788
Copy link

:(
I will give a try to rustdoc once more. Compilations on my machine take around 1 hour, so i don't know if i can fix something that way.

@ketsuban
Copy link
Contributor

I believe I have an explanation.

The #[doc(hidden)] annotation on the modules ensures no documentation is created for the module or any traits or similar contained within it. However, when assessing whether impls should be hidden on other pages the documentation compiler considers only the hiddenness of the impl itself, not its containing module.

I suspect the existing behaviour is working as intended—consider the case of someone putting their impl Add<Foo> for Bar (given public types Foo and Bar) in a doc-hidden module and then wondering where the impl went. I recommend the simple fix of putting #[doc(hidden)] on the impls of the public-not-public traits.

@hanna-kruppe
Copy link
Contributor

@ketsuban Thanka for tracking this down! You are right that impls in private modules should generally be displayed since they are public in a sense. But I think the current state of affairs is very unsatisfying, since Rustdoc generates broken docs for perfectly valid code. Shouldn't it at the very least somit links that will wind up dead? And if both trait and implementing type are dic(hidden), as is the case here, it seems like a reasonable heuristic to treat the impl as hidden too. I'm less sure about hidden traits in public types (e.g., RawFloat and f64) but if it's overridable it also seems sensible.

@ketsuban
Copy link
Contributor

Putting my real-world-concerns hat on, I think this is really just a corner case where pub and “public” don't coincide. The Right Thing is to propagate #[doc(hidden)] from traits to impls of those traits; I don't know how difficult that is to do, so I opted for recommending a simple fix which I'd confirmed to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants