Skip to content

cfg(doc) is not respected on cross-crate re-export #114952

Open
@notriddle

Description

@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.

Meta

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions