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

Rustdoc links to std library types can bypass the facade #22083

Open
tomjakubowski opened this issue Feb 8, 2015 · 5 comments
Open

Rustdoc links to std library types can bypass the facade #22083

tomjakubowski opened this issue Feb 8, 2015 · 5 comments
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@tomjakubowski
Copy link
Contributor

As an example, generate documentation for this:

#![crate_type="lib"]

pub trait Trait { }

impl<T> Trait for Vec<T> { }

On the docs for the Trait trait, there will be an Implementors section like this:

Note that the Vec link goes to docs for the collections crate and not to docs for std. Since the 1.0 release will not host documentation for crates behind the facade, this will lead to broken documentation links for third-party crates.

@tomjakubowski tomjakubowski changed the title Rustdoc links to std library types pass through the facade Rustdoc links to std library types can bypass the facade Feb 8, 2015
@alexcrichton alexcrichton added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 9, 2015
@steveklabnik
Copy link
Member

Triage: this is still true today.

@chordowl
Copy link
Contributor

Triage: looks like this is fixed (see e.g. here or here).

@steveklabnik
Copy link
Member

@lukaramu in the second link, it still looks like it's linking to libcollections, not to libstd?

@chordowl
Copy link
Contributor

@steveklabnik seems like I was too superficial, my bad...

Upon taking a closer look, there seem to be multiple components:

A lot of trait implementors are duplicate, this seems to be #25061. The initial entries (mostly, see below) link within libstd (which led me to believe that this was fixed); the entries that are generated dynamically (everything after impl PartialEq for SystemTime) bypass the facade, e.g. Box/Arc/Rc to liballoc, DecodeUtf16Error to libstd_unicode, etc.

Then, even the not dynamically generated entry for the implementation by EnumSet links to libcollections, which in some way makes sense as it isn't in std::collections anyway.

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@AlexArgoAi
Copy link

This is still a problem today.

Documenting this library:

use std::rc::Rc;

pub fn foo() -> Rc<()> {
    Rc::new(())
}

will produce a link to https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html rather than https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html.

@jyn514 jyn514 added the A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate label Apr 8, 2021
@ehuss ehuss removed the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label Jan 18, 2022
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 C-bug Category: This is a bug. 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

8 participants