cfg(doc) is not respected on cross-crate re-export · Issue #114952 · rust-lang/rust (original) (raw)

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.

Meta

This issue can be reproduced in both the stable and nightly version of the compiler.