- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
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)
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
  |
Metadata
Metadata
Assignees
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
