Skip to content

Conversation

@GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Mar 24, 2025

Implementation of rust-lang/rfcs#3631.

This implementation actually resulted in a lot of simplifications:

  • All cfg computation is now done in one place: propagate_doc_cfg.rs. Because (trait) impls are not retrieved at the same time as the other items, we cannot perform this computation in the clean process, it needs to be after.
  • Because there is cfg inheritance, we can keep track of them in one place (in propagate_doc_cfg.rs), meaning we don't need to copy an item's attributes to its children anymore. Only exception: impl items. For them we clone only cfg attributes.
  • propagate_doc_cfg.rs is also now much simpler, much less need to keep track of parents, since everything we need is handled by the new CfgInfo type.
  • I also suspect that Cfg::simplify_with could either be removed or at least used directly into propagate_doc_cfg.rs when we compute cfgs. Considering how big the PR already is, I'll do it in a follow-up.

I didn't remove the doc_cfg* features in this PR because some dependencies used in rustc (like stdarch) are using it, so we need to have a nightly released with this PR before I can switch to the new feature.

r? ghost

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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 Mar 24, 2025
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

What remains to be done:

I'd also want to block the stabilization on landing #138844 to avoid a stable rustdoc feature relying on externally observable hacks in rustc.
The crater run in #138844 returned mostly clean, so I expect it to land soon.

@GuillaumeGomez
Copy link
Member Author

Noted! And that will be a nice improvement, thanks!

Just one thing left for the cfg expansion missing: #[cfg_attr(blabla, derive(Debug))]. In this case, the cfg is not kept in the generated derive items. It's been in my TODO list for a long time now. ^^'

@petrochenkov
Copy link
Contributor

Just one thing left for the cfg expansion missing: #[cfg_attr(blabla, derive(Debug))]

Do you mean like in #138515? :)

@GuillaumeGomez
Copy link
Member Author

You're my hero! Gonna need to handle this new attribute then. :)

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Mar 25, 2025

☔ The latest upstream changes (presumably #138923) made this pull request unmergeable. Please resolve the merge conflicts.

@GuillaumeGomez GuillaumeGomez force-pushed the rfc-3631 branch 2 times, most recently from d88598f to db25eea Compare March 27, 2025 10:18
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Mar 27, 2025
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Mar 27, 2025

☔ The latest upstream changes (presumably #138927) made this pull request unmergeable. Please resolve the merge conflicts.

@GuillaumeGomez GuillaumeGomez force-pushed the rfc-3631 branch 2 times, most recently from b8cb424 to b581ce1 Compare March 28, 2025 23:54
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the rfc-3631 branch 4 times, most recently from 71369a1 to fbee8a9 Compare April 1, 2025 15:52
@rust-log-analyzer

This comment has been minimized.

jeertmans added a commit to Rolv-Apneseth/languagetool-rust that referenced this pull request Oct 31, 2025
jeertmans added a commit to jeertmans/languagetool-rust that referenced this pull request Oct 31, 2025
* chore(deps): update various dependencies

* chore(deps): update checkout and CodSpeedHQ actions

* chore(ci): specify mode for `CodSpeedHQ` action

* chore!: bump minimum Rust version, `1.82.0` -> `1.88.0`

* fix(docs): rename `doc_auto_cfg` attribute

See rust-lang/rust#138907

* fix(ci): require `read` permission for crates' token

* chore(ci): remove duplicate test for docs

* fix

* fix(ci): only check if access token is set

* fix(ci): better emulate docsrs by not building dependencies

---------

Co-authored-by: Jérome Eertmans <[email protected]>
defi-scripter470po added a commit to defi-scripter470po/soldeer that referenced this pull request Nov 1, 2025
* feat(lock): add support for private packages

* refactor(error): rename error variant

* feat(core): support installing private package

* feat(registry): authenticate all requests if logged in

* feat: save correct lockfile entry for private projects

* test(core): add install private package test

* docs: doc_auto_cfg merged into doc_cfg

Ref: rust-lang/rust#138907

* test: add integration test
nicholasbishop added a commit to google/sbat-rs that referenced this pull request Nov 3, 2025
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
nicholasbishop added a commit to google/sbat-rs that referenced this pull request Nov 3, 2025
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
nicholasbishop added a commit to google/authenticode-rs that referenced this pull request Nov 3, 2025
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
nicholasbishop added a commit to nicholasbishop/ext4-view-rs that referenced this pull request Nov 3, 2025
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
nicholasbishop added a commit to google/gpt-disk-rs that referenced this pull request Nov 3, 2025
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
nicholasbishop added a commit to google/gpt-disk-rs that referenced this pull request Nov 3, 2025
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
nicholasbishop added a commit to nicholasbishop/ext4-view-rs that referenced this pull request Nov 3, 2025
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
nicholasbishop added a commit to google/authenticode-rs that referenced this pull request Nov 3, 2025
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
nicholasbishop added a commit to google/sbat-rs that referenced this pull request Nov 3, 2025
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
nicholasbishop added a commit to nicholasbishop/ext4-view-rs that referenced this pull request Nov 3, 2025
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907
PitiBouchon pushed a commit to JustRustThings/xmpp-rs that referenced this pull request Nov 10, 2025
skip-changelog, we don't officially support nightly.

See-Also: rust-lang/rfcs#3631
See-Also: rust-lang/rust#138907
drott added a commit to drott/fontations that referenced this pull request Nov 11, 2025
Replace `doc_auto_cfg` with `doc_cfg`, see
rust-lang/rust#138907

Fixes issues with docs.rs builds of Fontations crates.
dfrg pushed a commit to googlefonts/fontations that referenced this pull request Nov 11, 2025
Replace `doc_auto_cfg` with `doc_cfg`, see
rust-lang/rust#138907

Fixes issues with docs.rs builds of Fontations crates.
seijikun pushed a commit to seijikun/uefi-rs that referenced this pull request Nov 12, 2025
Our latest release failed to build on docs.rs [1] because the `doc_auto_cfg`
feature has been subsumed by `doc_cfg`:
rust-lang/rust#138907

[1]: https://docs.rs/crate/uefi/0.36.0/builds/2603179
zachschuermann added a commit to delta-io/delta-kernel-rs that referenced this pull request Nov 13, 2025
## What changes are proposed in this pull request?
Noticed docs didn't build successfully for [0.17.0
release](https://docs.rs/crate/delta_kernel/0.17.0/builds/2652981) since
in rustc 1.92 the `doc_auto_cfg` feature was removed (and TIL docs.rs
builds with nightly). This pr just moves from the `doc_auto_cfg` to
`doc_cfg` (see associated [rust
pr](rust-lang/rust#138907)).

## How was this change tested?
docs only. reproed with `cargo +nightly doc`
zachschuermann added a commit to zachschuermann/delta-kernel-rs that referenced this pull request Nov 13, 2025
## What changes are proposed in this pull request?
Noticed docs didn't build successfully for [0.17.0
release](https://docs.rs/crate/delta_kernel/0.17.0/builds/2652981) since
in rustc 1.92 the `doc_auto_cfg` feature was removed (and TIL docs.rs
builds with nightly). This pr just moves from the `doc_auto_cfg` to
`doc_cfg` (see associated [rust
pr](rust-lang/rust#138907)).

## How was this change tested?
docs only. reproed with `cargo +nightly doc`
AsakuraMizu added a commit to arceos-org/axplat_crates that referenced this pull request Nov 14, 2025
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 merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.