Description
I have a macro crate with a "peer dependency" on another crate, i.e. I can't write doctests for the macro itself without introducing circular dev-dependencies which are kind of annoying. The other crate re-exports the macro and the macro is actually expected to only ever be used through there, so I documented the re-export instead. However, there's another higher-level crate that re-exports a bunch of other crates entirely including the one that re-exports the macro. In the documentation of the higher-level crate, the documentation for the macro does not appear, while it appears on the "level-one" re-export.
Minimal reproduction:
Crate foo re-exports a type from bar, which is itself a re-export of a type from baz. The docs on each of the declarations (original type definition in baz
, re-exports in bar
and foo
) are simply the crate name
// # baz/src/lib.rs
/// baz
pub struct Type;
// # bar/src/lib.rs
/// bar
pub use baz::Type;
// # foo/src/lib.rs
/// foo
pub use bar::Type;
Here is a repo with this: https://github.com/jplatte/rust-issue-81893
I expected to see this happen: the docs of foo::Type
should be foo bar baz
Instead, this happened: the docs of foo::Type
are foo baz
Meta
Happens with latest nightly from rustup that has rustfmt:
rustc --version --verbose
:
rustc 1.51.0-nightly (04caa632d 2021-01-30)
binary: rustc
commit-hash: 04caa632dd10c2bf64b69524c7f9c4c30a436877
commit-date: 2021-01-30
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1
Activity
jyn514 commentedon Feb 9, 2021
Some related bugs:
only shows
baz
in the docs, as doesjyn514 commentedon Feb 9, 2021
A bit of trivia, not particularly helpful: In 1.33, the cross-crate issue behaved as the single crate issue and only showed
baz
.TaKO8Ki commentedon Feb 15, 2021
@rustbot claim
TaKO8Ki commentedon Mar 9, 2021
It is about work on this issue!
jyn514 commentedon Apr 2, 2021
@TaKO8Ki hi, have you made any progress on this issue? No problem if not, but please comment
@rustbot release-assignment
if so, so other people can work on it.TaKO8Ki commentedon Apr 2, 2021
@jyn514
I'm sorry. I was busy a while ago, but I have some time on my hands these days, so can I work on this issue some more?
jyn514 commentedon Apr 2, 2021
Sure thing. If it helps, I think this is the place to look:
rust/src/librustdoc/clean/inline.rs
Line 287 in 4fa76a4
TaKO8Ki commentedon Apr 2, 2021
@jyn514
Thank you! I'm going to take a look.
21 remaining items