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

Stable Rustdoc contains broken links (to compiler internal crates) #43701

Closed
kumbayo opened this issue Aug 6, 2017 · 4 comments
Closed

Stable Rustdoc contains broken links (to compiler internal crates) #43701

kumbayo opened this issue Aug 6, 2017 · 4 comments
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@kumbayo
Copy link

kumbayo commented Aug 6, 2017

The nightly rustdoc for Deref contains multiple links under Implementors which do not work.
https://doc.rust-lang.org/nightly/std/ops/trait.Deref.html
for example InternedString, RcSlice<T>, ThinVec<T>, P<T>, ...

rustdoc_nightly_deref

Those links seem to come from internal crates like
rustc_data_structures, rustc_errors, syntax, syntax_pos

The problem does not appear for the stable documentation.
https://doc.rust-lang.org/stable/std/ops/trait.Deref.html

@Mark-Simulacrum
Copy link
Member

I suspect that this may be due to an order change in how rustdoc builds things, or possibly a missing conditional around something. Unless something has landed into rustdoc itself recently that could cause this?

@Mark-Simulacrum Mark-Simulacrum added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 6, 2017
@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. and removed T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 10, 2017
bors added a commit that referenced this issue Aug 12, 2017
rustdoc: Don't add external impls to implementors js

Otherwise impls from not documented crates appear.

Fixes #43701
@QuietMisdreavus
Copy link
Member

Looks like #43736 didn't fully solve this. There are some traits and types that are showing up without being in the implementors js file.

For example, f32 is shown to implement a trait from compiler_builtins:

image

And several types are showing up as implementors of Copy from crates like rand and libc:

image

While Float isn't showing up on stable right now, the rand and libc types are.

@shepmaster shepmaster changed the title Nightly Rustdoc contains broken links (to compiler internal crates) Stable Rustdoc contains broken links (to compiler internal crates) Sep 1, 2017
@shepmaster
Copy link
Member

shepmaster commented Sep 1, 2017

@jethrogb on #44175 states:

On the stable std::fmt::Debug page, under implementors, there's a bunch of links to the nightly documentation of the in-tree rand crate. What's more, the links don't work.

This first appeared in the 1.16 docs. Problem still exists in beta as of the 1.20 release candidate.

@QuietMisdreavus
Copy link
Member

I have an open PR #44026 to address this, but i'm waiting for some confirmation from the dev-tools team to make sure i can merge it.

bors added a commit that referenced this issue Sep 19, 2017
hide internal types/traits from std docs via new #[doc(masked)] attribute

Fixes #43701 (hopefully for good this time)

This PR introduces a new parameter to the `#[doc]` attribute that rustdoc looks for on `extern crate` statements. When it sees `#[doc(masked)]` on such a statement, it hides traits and types from that crate from appearing in either the "Trait Implementations" section of many type pages, or the "Implementors" section of trait pages. This is then applied to the `libc`/`rand`/`compiler_builtins` imports in libstd to prevent those crates from creating broken links in the std docs.

Like in #43348, this also introduces a feature gate, `doc_masked`, that controls the use of this parameter.

To view the std docs generated with this change, head to https://tonberry.quietmisdreavus.net/std-43701/std/index.html.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants