Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CAD97 opened this issue Apr 18, 2022 · 3 comments
Open

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

CAD97 opened this issue Apr 18, 2022 · 3 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. F-doc_cfg `#![feature(doc_cfg)]` requires-nightly This issue requires a nightly compiler in some way. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@CAD97
Copy link
Contributor

CAD97 commented Apr 18, 2022

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?)

@CAD97 CAD97 added the C-bug Category: This is a bug. label Apr 18, 2022
@rustbot rustbot added A-rustdoc-ui Area: Rustdoc UI (generated HTML) requires-nightly This issue requires a nightly compiler in some way. labels Apr 18, 2022
@CAD97
Copy link
Contributor Author

CAD97 commented Apr 18, 2022

@rustbot label +T-rustdoc
(again, maybe?)

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 18, 2022
@mejrs
Copy link
Contributor

mejrs commented Apr 19, 2022

This looks like #83428

@CAD97
Copy link
Contributor Author

CAD97 commented Apr 19, 2022

This is likely the same root issue, but is a different expression of the issue; in #83428 the cfg is present for the source item as well, but I'm applying the cfg to just the reëxport.

@Nemo157 Nemo157 added the F-doc_cfg `#![feature(doc_cfg)]` label Jun 21, 2023
imrn99 added a commit to LIHPC-Computational-Geometry/honeycomb that referenced this issue Sep 3, 2024
it should work the way this is fixed:
rust-lang/rust#96166
imrn99 added a commit to LIHPC-Computational-Geometry/honeycomb that referenced this issue Sep 4, 2024
* add new member with subcrates re-exports

* explicitly re-export core items instead of using its prelude

* add documentation for the new crate

* add nightly feature documentation

it should work the way this is fixed:
rust-lang/rust#96166

* exclude user crate from coverage CI

* fix copypaste mistake in CI

* add links to important items in crate-level doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. F-doc_cfg `#![feature(doc_cfg)]` requires-nightly This issue requires a nightly compiler in some way. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants