Skip to content

Conversation

@fmease
Copy link
Member

@fmease fmease commented Nov 7, 2025

Fixes #141301.

Rambling about target_feature which I didn't touch here

Regarding #141301 (comment) (#[target_feature(enable = …)] on inlined cross-crate re-exports), it has the same underlying cause (namely, we neither encode target_feature nor AttributeKind::TargetFeature in the crate metadata). However, I didn't make that change because I first want to experiment with querying TyCtxt::codegen_fn_attrs in rustdoc instead which already works cross-crate (and also use to it for reconstructing no_mangle, export_name, link_section to avoid encoding these attributes unnecessarily (basically reverting #144050) as suggested in #144004 (comment)).

r? GuillaumeGomez

@rustbot rustbot added 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-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 Nov 7, 2025
@fmease fmease added the F-doc_cfg `#![feature(doc_cfg)]` label Nov 7, 2025
@GuillaumeGomez
Copy link
Member

Great, thanks! r=me once CI pass.

@rust-log-analyzer
Copy link
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
spellchecking files
building external tool typos from package typos-cli@1.38.1
finished building tool typos
npm WARN deprecated puppeteer@22.15.0: < 24.10.2 is no longer supported
npm ERR! code 127
npm ERR! git dep preparation failed
npm ERR! command /node/bin/node /node/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/user/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm ERR! npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm ERR! npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm ERR! npm WARN deprecated readdir-scoped-modules@1.1.0: This functionality has been moved to @npmcli/fs
npm ERR! npm WARN deprecated debuglog@1.0.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm ERR! npm WARN deprecated read-package-json@2.1.2: This package is no longer supported. Please use @npmcli/package-json instead.
npm ERR! npm WARN deprecated read-installed@4.0.3: This package is no longer supported.
npm ERR! npm ERR! code 127
npm ERR! npm ERR! path /home/user/.npm/_cacache/tmp/git-cloneXXXXXXPTKYas/node_modules/rollup
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c patch-package
npm ERR! npm ERR! sh: 1: patch-package: not found
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in: /home/user/.npm/_logs/2025-11-07T17_19_17_404Z-debug-0.log

npm ERR! A complete log of this run can be found in: /home/user/.npm/_logs/2025-11-07T17_19_10_175Z-debug-0.log
npm install did not exit successfully
tidy [extra_checks]: IO error: npm install returned exit code exit status: 127
tidy [extra_checks]: FAIL
tidy: The following check failed: extra_checks
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/rust-tidy /checkout /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo /checkout/obj/build 4 /node/bin/npm --extra-checks=py,cpp,js,spellcheck` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1549:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1279:29

Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Build completed unsuccessfully in 0:02:57
  local time: Fri Nov  7 17:19:37 UTC 2025
  network time: Fri, 07 Nov 2025 17:19:37 GMT
##[error]Process completed with exit code 1.

@JonathanBrouwer
Copy link
Contributor

cfg is quite a perf sensitive attribute since it's used so much, also had problems with it during the port of cfg to the new attribute system. Lets run perf before merging to make sure this doesn't regress compile times.
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 7, 2025
Encode cfg trace, not its early counterpart to fix cross-crate `doc(auto_cfg)`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 7, 2025
@JonathanBrouwer JonathanBrouwer added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Nov 7, 2025
@rust-bors
Copy link

rust-bors bot commented Nov 7, 2025

☀️ Try build successful (CI)
Build commit: 8d673fe (8d673fea7197257987241009c5975c1128b1e405, parent: 843f8ce2ebc01d35a30484eadc8a84cdc6130844)

@rust-timer

This comment has been minimized.

@fmease fmease removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 7, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8d673fe): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 14
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 13
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 14

Max RSS (memory usage)

Results (primary -2.6%, secondary -2.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.6% [-4.1%, -1.2%] 2
Improvements ✅
(secondary)
-2.7% [-3.3%, -2.1%] 2
All ❌✅ (primary) -2.6% [-4.1%, -1.2%] 2

Cycles

Results (secondary 7.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
7.1% [3.8%, 10.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.6%, secondary 0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.6% [0.0%, 2.8%] 77
Regressions ❌
(secondary)
0.4% [0.1%, 1.6%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [0.0%, 2.8%] 77

Bootstrap: 483.325s -> 473.961s (-1.94%)
Artifact size: 390.81 MiB -> 390.81 MiB (-0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 8, 2025
@fmease
Copy link
Member Author

fmease commented Nov 8, 2025

Well that's to be expected as we're strictly doing more work here. Namely, encoding & decoding more attributes (previously, with sym::cfg{,_attr} we didn't encode any attributes IINM as those didn't exist anymore at this stage in the compilation process having been superseded by sym::cfg{,_attr}_trace).

Moreover, this fixes a correctness regression (introduced in #138844), so this is justified. I did look at the perf improvements of the rollup that included the regressing PR (#139023 (comment)) but my findings weren't conclusive (a hypothesis of mine was that we're just reverting the perf improvements of the regressing PR to end up at a net zero).

Anyway, I find the regression justifiable.

@rustbot label perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Nov 8, 2025
@fmease
Copy link
Member Author

fmease commented Nov 8, 2025

@bors r=GuillaumeGomez

@bors
Copy link
Collaborator

bors commented Nov 8, 2025

📌 Commit 6419f9a has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 8, 2025
@JonathanBrouwer
Copy link
Contributor

JonathanBrouwer commented Nov 8, 2025

Yep sounds reasonable, just wanted to make sure we are aware of the performance impact when making this change :)

@Zalathar
Copy link
Member

Zalathar commented Nov 9, 2025

Scheduling: Prefer never over iffy if the rollup fails.

@bors p=1

@bors
Copy link
Collaborator

bors commented Nov 9, 2025

⌛ Testing commit 6419f9a with merge ab67c37...

@bors
Copy link
Collaborator

bors commented Nov 9, 2025

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing ab67c37 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 9, 2025
@bors bors merged commit ab67c37 into rust-lang:master Nov 9, 2025
21 of 24 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 20f1c04 (parent) -> ab67c37 (this PR)

Test differences

Show 6 test diffs

Stage 1

  • [rustdoc] tests/rustdoc/inline_cross/doc-auto-cfg.rs: [missing] -> pass (J1)
  • [rustdoc] tests/rustdoc/reexport/doc_auto_cfg-reexport-foreign-113982.rs: pass -> [missing] (J1)

Stage 2

  • [rustdoc] tests/rustdoc/inline_cross/doc-auto-cfg.rs: [missing] -> pass (J0)
  • [rustdoc] tests/rustdoc/reexport/doc_auto_cfg-reexport-foreign-113982.rs: pass -> [missing] (J0)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard ab67c37c6dbea849aa3425146bfe99fb1f1d117a --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. aarch64-apple: 9623.6s -> 7274.2s (-24.4%)
  2. x86_64-gnu-llvm-20: 2202.8s -> 2728.0s (+23.8%)
  3. dist-aarch64-apple: 7016.3s -> 5685.5s (-19.0%)
  4. dist-apple-various: 3124.1s -> 3487.4s (+11.6%)
  5. dist-loongarch64-musl: 5011.1s -> 5556.9s (+10.9%)
  6. x86_64-gnu: 6944.1s -> 7604.2s (+9.5%)
  7. dist-various-1: 3818.8s -> 4150.2s (+8.7%)
  8. dist-x86_64-musl: 7059.4s -> 7668.1s (+8.6%)
  9. i686-gnu-2: 6505.8s -> 5963.7s (-8.3%)
  10. dist-x86_64-windows-gnullvm: 4845.8s -> 5240.1s (+8.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@fmease fmease deleted the cross-crate-cfg branch November 9, 2025 15:07
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ab67c37): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 10
Regressions ❌
(secondary)
0.1% [0.1%, 0.3%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 10

Max RSS (memory usage)

Results (primary -7.9%, secondary 0.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.1% [0.7%, 3.3%] 4
Improvements ✅
(primary)
-7.9% [-7.9%, -7.9%] 1
Improvements ✅
(secondary)
-4.0% [-4.0%, -4.0%] 1
All ❌✅ (primary) -7.9% [-7.9%, -7.9%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

Results (primary 0.5%, secondary 0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.5% [0.0%, 2.8%] 77
Regressions ❌
(secondary)
0.4% [0.1%, 1.2%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.0%, 2.8%] 77

Bootstrap: 477.048s -> 475.32s (-0.36%)
Artifact size: 391.28 MiB -> 391.34 MiB (0.02%)

makai410 pushed a commit to makai410/rust that referenced this pull request Nov 10, 2025
…omez

Encode cfg trace, not its early counterpart to fix cross-crate `doc(auto_cfg)`

Fixes rust-lang#141301.

<details><summary>Rambling about <code>target_feature</code> which I didn't touch here</summary>

Regarding rust-lang#141301 (comment) (`#[target_feature(enable = …)]` on inlined cross-crate re-exports), it has the same underlying cause (namely, we neither encode `target_feature` nor `AttributeKind::TargetFeature` in the crate metadata). However, I didn't make that change because I first want to experiment with querying `TyCtxt::codegen_fn_attrs` in rustdoc instead which already works cross-crate (and also use to it for reconstructing `no_mangle`, `export_name`, `link_section` to avoid encoding these attributes unnecessarily (basically reverting rust-lang#144050) as suggested in rust-lang#144004 (comment)).

</details>

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) F-doc_cfg `#![feature(doc_cfg)]` 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-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.

rustdoc no longer applies a cfg badge to certain inlined cross-crate re-exported items with a #[cfg]

8 participants