Closed as not planned
Description
Problem
From the issue originally reported to rustdoc by @notriddle:
I tried this code:
// crate a
pub struct MyStruct;
#[cfg(doc)]
impl MyStruct {
pub fn doc_only_method() {}
}
// crate b
#[doc(inline)]
pub use a::MyStruct;
I expected to see this happen: I expected doc_only_method to appear in crate b
Instead, this happened: It didn't.
Proposed Solution
Rustdoc adds the doc
cfg before generating the docs for a crate (here), but the metadata from dependencies are generated using rustc without such flag, causing the problem above.
cargo doc
should add the cfg to the rustc calls that generate the metadata passed to rustdoc.
Notes
A few possibly related issues: