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

[src] links in beta and nightly documentation are broken #37684

Closed
RalfJung opened this issue Nov 10, 2016 · 9 comments · Fixed by #37954
Closed

[src] links in beta and nightly documentation are broken #37684

RalfJung opened this issue Nov 10, 2016 · 9 comments · Fixed by #37954
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

At least some of the [src] links in the beta standard library documentation are currently broken. I tried https://doc.rust-lang.org/beta/std/iter/trait.Iterator.html and https://doc.rust-lang.org/beta/std/iter/trait.IntoIterator.html.

@bluss bluss changed the title [src] links in beta documentation are broken [src] links in beta and nightly documentation are broken Nov 10, 2016
@bluss bluss added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 10, 2016
@bluss
Copy link
Member

bluss commented Nov 10, 2016

Seems to affect some items that libstd reexports from libcore.

@alexcrichton
Copy link
Member

I'd also be interested in investigating why CI isn't catching this...

@GuillaumeGomez
Copy link
Member

The [src] link should be generated based on the "original" item instead of the current one. (spitting out the obvious)

@bluss bluss added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-from-stable-to-stable Performance or correctness regression from one stable version to another. labels Nov 11, 2016
@bluss
Copy link
Member

bluss commented Nov 11, 2016

Ok, good news, this bug did not migrate to stable when beta did?

@bluss bluss added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Nov 11, 2016
@alexcrichton
Copy link
Member

Something looks off-by-one in the gotosrc links (which is why linkchecker didn't catch this). libstd thinks the iterator trait is 3636 and libcore thinks it's 3637. Sounds like the ids used by rustdoc are perhaps no longer valid?

@GuillaumeGomez
Copy link
Member

Taking a look.

eddyb added a commit to eddyb/rust that referenced this issue Nov 12, 2016
@bluss
Copy link
Member

bluss commented Nov 12, 2016

Thanks for fixing this! rustdoc improvements = ❤️

@ollie27
Copy link
Member

ollie27 commented Nov 18, 2016

This isn't fixed. See std::str::Chars. The link is https://doc.rust-lang.org/nightly/core/str/struct.Chars.html?gotosrc=42892 but it should be https://doc.rust-lang.org/nightly/core/str/struct.Chars.html?gotosrc=42906. They differ by 14 which is the same number of items with #[cfg(dox)] in src/libcore/macros.rs so I think it's the same issue.

@GuillaumeGomez
Copy link
Member

Taking another look then.

bors added a commit that referenced this issue Nov 30, 2016
rustdoc: link to cross-crate sources directly.

Fixes #37684 by implementing proper support for getting the `Span` of definitions across crates.
In rustdoc this is used to generate direct links to the original source instead of fragile redirects.

This functionality could be expanded further for making error reporting code more uniform and seamless across crates, although at the moment there is no actual source to print, only file/line/column information.

Closes #37870 which is also "fixes" #37684 by throwing away the builtin macro docs from libcore.
After this lands, #37727 could be reverted, although it doesn't matter much either way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. 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.

5 participants