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 :)

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)]` 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]

7 participants