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.

qrnch-jan added a commit to qrnch-jan/sponges that referenced this pull request Oct 3, 2025
arqunis pushed a commit to serenity-rs/serenity that referenced this pull request Oct 4, 2025
Fixes docs publishing by switching to the new feature merged in
rust-lang/rust#138907
NobodyXu added a commit to NobodyXu/flate2-rs that referenced this pull request Oct 5, 2025
Nightly feature doc_auto_cfg is merged into doc_cfg rust-lang/rust#138907
AlexTMjugador added a commit to zopfli-rs/zopfli that referenced this pull request Oct 5, 2025
Multirious added a commit to Multirious/bevy_time_runner that referenced this pull request Oct 5, 2025
Multirious added a commit to Multirious/bevy_time_runner that referenced this pull request Oct 5, 2025
* Update CHANGELOG.md

* Update flake.nix

File copy from bevy_tween at e6c30ca44213b4a7867925e722838c68edf24fa0

* nix flake update

* cargo update

* Change doc_auto_cfg to doc_cfg since rust-lang/rust#138907

* Update CHANGELOG.md

* Bump version to 0.5.2

* cargo update
Multirious added a commit to Multirious/bevy_tween that referenced this pull request Oct 5, 2025
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Oct 6, 2025
Move doc_cfg-specific code into `cfg.rs`

Follow-up of rust-lang/rust#138907.

r? lolbinarycat
Rabbival added a commit to Multirious/bevy_tween that referenced this pull request Oct 6, 2025
* give name to closure variable types to prevent future confusion

* Update CHANGELOG.md

* Seperate rust package from buildInputs into stableRust

* Add docrs devshell with nightly Rust

* nix flake update

* Update devshell stableRust to 1.90.0

* Update bevy_time_runner to 0.5.2

* Change doc_auto_cfg to doc_cfg since rust-lang/rust#138907

* Update unreleased changes section in CHANGELOG.md

* fix import in docs

* update EguiPlugin in bevy_lookup_curve

---------

Co-authored-by: Multirious <[email protected]>
tisonkun added a commit to fast/logforth that referenced this pull request Oct 6, 2025
tomcur added a commit to endoli/fiksi that referenced this pull request Oct 6, 2025
roypat added a commit to roypat/vm-memory that referenced this pull request Oct 6, 2025
the `doc_auto_cfg` feature has been merged into `doc_cfg` [1], and this
is breaking building vm-memory documentation on docs.rs [2].

[1]: rust-lang/rust#138907
[2]: https://docs.rs/crate/vm-memory/0.17.0/builds/2564760

Signed-off-by: Patrick Roy <[email protected]>
aws-sdk-rust-ci pushed a commit to smithy-lang/smithy-rs that referenced this pull request Oct 6, 2025
#4331)

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Our docrs builds started
[failing](https://docs.rs/crate/aws-sdk-dynamodb/1.94.0/builds/2555063)
recently with the error:
```
[INFO] [stderr]  Documenting aws-sdk-dynamodb v1.94.0 (/opt/rustwide/workdir)
[INFO] [stderr] error[E0557]: feature has been removed
[INFO] [stderr]   --> src/lib.rs:21:29
[INFO] [stderr]    |
[INFO] [stderr] 21 | #![cfg_attr(docsrs, feature(doc_auto_cfg))]
[INFO] [stderr]    |                             ^^^^^^^^^^^^ feature has been removed
[INFO] [stderr]    |
[INFO] [stderr]    = note: removed in CURRENT_RUSTC_VERSION; see <rust-lang/rust#138907> for more information
[INFO] [stderr]    = note: merged into `doc_cfg`
[INFO] [stderr] 
[INFO] [stderr] error: Compilation failed, aborting rustdoc
[INFO] [stderr] 
[INFO] [stderr] For more information about this error, try `rustc --explain E0557`.
[INFO] [stderr] error: could not document `aws-sdk-dynamodb`
```

The [linked issue](rust-lang/rust#138907) shows
that `doc_auto_cfg` has recently been merged into `doc_cfg`. docsrs
builds with the latest nightly toolchain, so the change has impacted our
doc builds. This PR makes that change in codegen and in all of our
runtime crates.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] For changes to the smithy-rs codegen or runtime crates, I have
created a changelog entry Markdown file in the `.changelog` directory,
specifying "client," "server," or both in the `applies_to` key.
- [ ] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
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.