Skip to content

rustdoc: use anonymous constant for primitives/keywords/attribute docs - #160288

Open
mejrs wants to merge 1 commit into
rust-lang:mainfrom
mejrs:anon_const_attr_docs
Open

rustdoc: use anonymous constant for primitives/keywords/attribute docs#160288
mejrs wants to merge 1 commit into
rust-lang:mainfrom
mejrs:anon_const_attr_docs

Conversation

@mejrs

@mejrs mejrs commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

For context: #t-rustdoc > hiding fake_item modules. @ 💬

r? @GuillaumeGomez

I've rendered the standard library docs and prims/kws/attrs all show up as normal.

However I could not figure out how to run some of the tests, so this may be a bit of CI-debugging for me :(

@rustbot

rustbot commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in GUI tests.

cc @GuillaumeGomez

These commits modify tests/rustdoc-json.
rustdoc-json is a public (but unstable) interface.

Please ensure that if you've changed the output:

  • It's intentional.
  • The FORMAT_VERSION in src/librustdoc-json-types is bumped if necessary.

cc @obi1kenobi

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jul 31, 2026
@rust-log-analyzer

This comment has been minimized.

@camelid

camelid commented Jul 31, 2026

Copy link
Copy Markdown
Member

However I could not figure out how to render std with private/hidden items shown (rustdocflags are ignored), nor how to run some of the tests, so this may be a bit of CI-debugging for me :(

Should be RUSTDOCFLAGS="--document-private-items --document-hidden-items" x doc library --stage 1 -- did that not work for you?

Comment thread library/core/src/attribute_docs.rs
@mejrs

mejrs commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

However I could not figure out how to render std with private/hidden items shown (rustdocflags are ignored), nor how to run some of the tests, so this may be a bit of CI-debugging for me :(

Should be RUSTDOCFLAGS="--document-private-items --document-hidden-items" x doc library --stage 1 -- did that not work for you?

Hmm, I did not pass stage 1 before, but that indeed works,.

@camelid

camelid commented Jul 31, 2026

Copy link
Copy Markdown
Member

Without --stage 1, it might be using the stage0 rustdoc to document std, which will be without your changes.

@mejrs
mejrs force-pushed the anon_const_attr_docs branch from 6b28e2e to c8a3129 Compare July 31, 2026 17:46
@mejrs

mejrs commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Without --stage 1, it might be using the stage0 rustdoc to document std, which will be without your changes.

Right, but I changed std to use anon consts so that should have errored . Maybe I don't quite understand how rustdoc interacts with bootstrapping. Or In just missed it before, we don't have that many private root modules in std actually. Regardless it works :)

@rust-log-analyzer

This comment has been minimized.

@mejrs
mejrs force-pushed the anon_const_attr_docs branch from c8a3129 to 82a5915 Compare July 31, 2026 19:04
@camelid camelid changed the title rustcdoc: use anonymous constant for primitives/keywords/attribute docs rustdoc: use anonymous constant for primitives/keywords/attribute docs Jul 31, 2026
@rust-log-analyzer

This comment has been minimized.

@mejrs
mejrs force-pushed the anon_const_attr_docs branch from 82a5915 to e94ce09 Compare July 31, 2026 19:45
@rust-log-analyzer

This comment has been minimized.

@mejrs
mejrs force-pushed the anon_const_attr_docs branch from e94ce09 to a72e4e8 Compare July 31, 2026 21:44
@rust-bors

This comment has been minimized.

@mejrs
mejrs force-pushed the anon_const_attr_docs branch from a72e4e8 to 51866cf Compare August 1, 2026 08:58
@rustbot

rustbot commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants