Skip to content

Conversation

@GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Oct 22, 2025

Fixes regression found out by @fmease here.

In short: the pass which checks the doc(cfg()) attributes needed to be moved before the private/hidden stripping items passes.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 22, 2025
@rustbot

This comment was marked as outdated.

@fmease fmease assigned fmease and unassigned notriddle Oct 22, 2025
@fmease
Copy link
Member

fmease commented Oct 22, 2025

How does this relate to your PR #147905 I just approved? It does the same thing but the tests differ.

@fmease
Copy link
Member

fmease commented Oct 22, 2025

Do you want to add these tests to the earlier PR #147905, reapprove it and close this one?

@GuillaumeGomez
Copy link
Member Author

I was able to completely forgot I already had a PR open to fix this bug. Oh well, at least this one is more complete... Closed the other one.

@fmease
Copy link
Member

fmease commented Oct 22, 2025

Doubly thanks! @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 22, 2025

📌 Commit e1e851d has been approved by fmease

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 22, 2025
@Urgau
Copy link
Member

Urgau commented Oct 22, 2025

It's weird that the propagate cfg doc pass emits those errors, it would make more sense to me if the check doc cfg pass were to emit those errors.

We probably need to modify the code around cfg_matches to emit those errors.

let _ = rustc_attr_parsing::cfg_matches(

@fmease
Copy link
Member

fmease commented Oct 22, 2025

@Urgau Yes, this is only a temporary fix. The proper fix should happen once we port over all #[doc(…)] to the new attribute parsing API (cc #147097). Ideally, we would fully validate the #[doc(cfg)] in rustc itself (so it's validated when you run rustc, not just when you run rustdoc) as I've mentioned here #138907 (comment).

bors added a commit that referenced this pull request Oct 22, 2025
Rollup of 5 pull requests

Successful merges:

 - #145617 (docs(style): Specify the frontmatter style)
 - #147830 (Reword unstable fingerprints ICE to ask for reproduction)
 - #147988 (Remove unused field `style` from `AttributeKind::CrateName`)
 - #147990 (Fix invalid jump to def link generated on derive attributes)
 - #147991 ([rustdoc] Check `doc(cfg())` even of private/hidden items)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 071b9de into rust-lang:master Oct 22, 2025
11 checks passed
rust-timer added a commit that referenced this pull request Oct 22, 2025
Rollup merge of #147991 - GuillaumeGomez:check-doc-cfg-private-hidden, r=fmease

[rustdoc] Check `doc(cfg())` even of private/hidden items

Fixes regression found out by `@fmease` [here](#138907 (comment)).

In short: the pass which checks the `doc(cfg())` attributes needed to be moved before the private/hidden stripping items passes.
@rustbot rustbot added this to the 1.92.0 milestone Oct 22, 2025
@GuillaumeGomez GuillaumeGomez deleted the check-doc-cfg-private-hidden branch October 23, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants