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

Docs feature banner will not show on top level docs when using glob export #120487

Closed
iamsauravsharma opened this issue Jan 30, 2024 · 9 comments · Fixed by #120501
Closed

Docs feature banner will not show on top level docs when using glob export #120487

iamsauravsharma opened this issue Jan 30, 2024 · 9 comments · Fixed by #120501
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. F-doc_cfg `#![feature(doc_cfg)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@iamsauravsharma
Copy link

I tried this code:

#![feature(doc_cfg)]

mod a {
    #[doc(cfg(feature = "a"))]
    #[cfg(feature = "a")]
    pub struct Test1;
}

pub use a::*;

I expected to see this happen:
Screenshot 2024-01-30 at 13-06-34 doc_cfg - Rust

Instead, this happened:
Screenshot 2024-01-30 at 13-06-57 doc_cfg - Rust

This is issue from nightly-2023-12-16. First screenshot is of nightly-2023-12-15 and second is of nightly-2023-12-16

@iamsauravsharma iamsauravsharma added the C-bug Category: This is a bug. label Jan 30, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 30, 2024
@Nemo157
Copy link
Member

Nemo157 commented Jan 30, 2024

Probably #113091, it shouldn't have affected glob re-exports but maybe did (cc @GuillaumeGomez).

@Nemo157 Nemo157 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) F-doc_cfg `#![feature(doc_cfg)]` and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 30, 2024
@GuillaumeGomez
Copy link
Member

Taking a look.

@GuillaumeGomez
Copy link
Member

Same issue with a simple reexport:

mod b {
    #[doc(cfg(not(feature = "a")))]
    #[cfg(not(feature = "a"))]
    pub struct Test2;
}

pub use b::Test2;

@Nemo157
Copy link
Member

Nemo157 commented Jan 30, 2024

That's what #113091 was meant to do, it wasn't meant to affect globs though.

@GuillaumeGomez
Copy link
Member

I think there is another issue with how it's handled because nothing is listed on the item itself too:

image

@GuillaumeGomez
Copy link
Member

Ok so it's the expected output for a non-glob reexport. I wrote the fix for glob reexports, just need to add tests.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jan 30, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jan 30, 2024
…merge-bugfix, r=notriddle

rustdoc: Correctly handle attribute merge if this is a glob reexport

Fixes rust-lang#120487.

The regression was introduced in rust-lang#113091. Only non-glob reexports should have been impacted.

cc `@Nemo157`
r? `@notriddle`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 30, 2024
…merge-bugfix, r=notriddle

rustdoc: Correctly handle attribute merge if this is a glob reexport

Fixes rust-lang#120487.

The regression was introduced in rust-lang#113091. Only non-glob reexports should have been impacted.

cc ``@Nemo157``
r? ``@notriddle``
Nadrieril added a commit to Nadrieril/rust that referenced this issue Jan 31, 2024
…merge-bugfix, r=notriddle

rustdoc: Correctly handle attribute merge if this is a glob reexport

Fixes rust-lang#120487.

The regression was introduced in rust-lang#113091. Only non-glob reexports should have been impacted.

cc ```@Nemo157```
r? ```@notriddle```
Nadrieril added a commit to Nadrieril/rust that referenced this issue Jan 31, 2024
…merge-bugfix, r=notriddle

rustdoc: Correctly handle attribute merge if this is a glob reexport

Fixes rust-lang#120487.

The regression was introduced in rust-lang#113091. Only non-glob reexports should have been impacted.

cc ````@Nemo157````
r? ````@notriddle````
@bors bors closed this as completed in 4eaf4c2 Jan 31, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jan 31, 2024
Rollup merge of rust-lang#120501 - GuillaumeGomez:glob-reexport-attr-merge-bugfix, r=notriddle

rustdoc: Correctly handle attribute merge if this is a glob reexport

Fixes rust-lang#120487.

The regression was introduced in rust-lang#113091. Only non-glob reexports should have been impacted.

cc `````@Nemo157`````
r? `````@notriddle`````
@iamsauravsharma
Copy link
Author

@GuillaumeGomez Latest nightly fixed the issue for #![feature(doc_cfg)] but it didn't fix the issue for #![feature(doc_auto_cfg)].
In latest nightly below example doesn't work

#![feature(doc_auto_cfg)]

mod a {
    #[cfg(feature = "a")]
    pub struct Test1;
}

pub use a::*;

its last working version was also nightly-2023-12-15.

@GuillaumeGomez
Copy link
Member

Noted. Sending a fix for it as well. :)

@GuillaumeGomez
Copy link
Member

Fixed in #120548.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 13, 2024
…erge, r=GuillaumeGomez

rustdoc: Fix handling of doc_auto_cfg feature for cfg attributes on glob reexport

This is a follow-up of rust-lang#120501 and a part of rust-lang#120487.

r? `@notriddle`
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 13, 2024
Rollup merge of rust-lang#120548 - GuillaumeGomez:glob-reexport-cfg-merge, r=GuillaumeGomez

rustdoc: Fix handling of doc_auto_cfg feature for cfg attributes on glob reexport

This is a follow-up of rust-lang#120501 and a part of rust-lang#120487.

r? `@notriddle`
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)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants