Skip to content

doc(cfg) doesn't work on glob reexports #96166

Open
@CAD97

Description

@CAD97

I tried this code:

#![feature(doc_auto_cfg, doc_cfg)]

#[doc(inline)]
#[cfg(feature = "raw")]
pub use crate::raw::*;

I expected to see this happen:

image

The doc_cfg note would appear on the reexported items.

Instead, this happened:

The doc_cfg note does not appear on glob reexported items. If items are reexported individually, the doc_cfg note does apply.

(My actual case has a #[cfg(feature = "raw") on a containing module, and then #[cfg(feature = "lib")] on the glob reexport. The cfg note for raw always appears, but "and lib" only appears for explicitly named items.)

Meta

rustc -Vv && rustdoc -Vv:

rustc 1.62.0-nightly (e7575f967 2022-04-14)
binary: rustc
commit-hash: e7575f9670f3c837def3d186ae09366c75c7632e
commit-date: 2022-04-14
host: x86_64-pc-windows-msvc
release: 1.62.0-nightly
LLVM version: 14.0.0

rustdoc 1.62.0-nightly (e7575f967 2022-04-14)
binary: rustdoc
commit-hash: e7575f9670f3c837def3d186ae09366c75c7632e
commit-date: 2022-04-14
host: x86_64-pc-windows-msvc
release: 1.62.0-nightly
LLVM version: 14.0.0

@rustbot modify labels: +A-rustdoc-ui +requires-nightly
(I think?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.F-doc_cfg`#![feature(doc_cfg)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions