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

intra-doc-resolution fails to link in re-exported types that don't match original module structure #60883

Closed
Nemo157 opened this issue May 16, 2019 · 2 comments
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Nemo157
Copy link
Member

Nemo157 commented May 16, 2019

Given a base crate

// bar/src/lib.rs
pub trait Foo {
    /// [`Bar`] [`Baz`]
    fn foo();
}

pub trait Bar {
}

pub trait Baz {
}

and a crate that uses that and re-exports types from it in a different structure

// foo/src/lib.rs
pub mod bar {
    pub use ::bar::Bar;
}

pub use ::bar::{Foo, Baz};

The links in the re-exported types only work when the module structure matches between the two crates (in this case for Baz but not for Bar)

Screenshot 2019-05-16 at 18 15 49

Rustdoc correctly warns that it can't resolve the link, but this seems like a primary usecase of the feature to allow facade crates to have correctly linked docs when they rearrange types from underlying crates.

warning: `[Bar]` cannot be resolved, ignoring it...
 --> /private/var/folders/0p/5yvmrvhj5w3_vy1y8x7dvk7m0000gn/T/tmp.lUuznfwf/foo/bar/src/lib.rs:2:10
  |
2 |     /// [`Bar`] [`Baz`]
  |          ^^^^^ cannot be resolved, ignoring
  |
@Nemo157
Copy link
Member Author

Nemo157 commented May 16, 2019

@rustbot modify labels to A-intra-doc-links T-rustdoc.

@rustbot rustbot added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 16, 2019
@Manishearth
Copy link
Member

Filed #65983 with more information on this so someone can pick it up if they want to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name 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

3 participants