Skip to content

Conversation

GuillaumeGomez
Copy link
Member

Follow-up of #138907.

r? lolbinarycat

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 28, 2025
@GuillaumeGomez
Copy link
Member Author

@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 Sep 28, 2025
…, r=<try>

Remove one loop in `extract_cfg_from_attrs`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 28, 2025
Copy link
Contributor

@lolbinarycat lolbinarycat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code is sound, as Attribute::ident always returns None for Attribute::Parsed, so there is no case where both branches would have run and now only one runs.

one question about a comment, otherwise lgtm.

View changes since this review


let mut changed_auto_active_status = None;

// First we get all `doc(auto_cfg)` attributes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this comment still make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't make sense even before. I'll just remove it.

@rust-bors
Copy link

rust-bors bot commented Sep 28, 2025

☀️ Try build successful (CI)
Build commit: 7b3f411 (7b3f4110d6faa0cbf30b4d01ad4d4f43c3b677e1, parent: c8905eaa66e0c35a33626e974b9ce6955c739b5b)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7b3f411): comparison URL.

Overall result: ❌ regressions - no action needed

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.

@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
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.5%)

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

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.7% [-3.7%, -3.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.5% [-3.7%, 2.7%] 2

Cycles

Results (secondary 2.8%)

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.8% [2.3%, 3.4%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 470.874s -> 471.366s (0.10%)
Artifact size: 387.66 MiB -> 387.66 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 29, 2025
@lolbinarycat
Copy link
Contributor

huh, looks like the perf is all noise. I almost thought the increase in cache misses could be something real, as it would match my intuition for potential performance downsides of this change, but on further inspection, none of those are for the doc profile, so it seems like they're just random noise.

still, i'd say it's an improvement to code quality

@GuillaumeGomez
Copy link
Member Author

@bors r=lolbinarycat rollup

@bors
Copy link
Collaborator

bors commented Sep 29, 2025

📌 Commit 2e63708 has been approved by lolbinarycat

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 29, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 29, 2025
…_from_attrs, r=lolbinarycat

Remove one loop in `extract_cfg_from_attrs`

Follow-up of rust-lang#138907.

r? lolbinarycat
bors added a commit that referenced this pull request Sep 29, 2025
Rollup of 6 pull requests

Successful merges:

 - #143613 (Fix backtraces with `-C panic=abort` on linux; emit unwind tables by default)
 - #146937 (std: implement `hostname`)
 - #147040 (mbe: macro_check: Fix function comments referencing non-existent parameters)
 - #147131 (Use MirPatch in simplify_branches.)
 - #147133 (Remove one loop in `extract_cfg_from_attrs`)
 - #147150 (Emit allocator attributes for allocator shim)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Sep 29, 2025
Rollup of 5 pull requests

Successful merges:

 - #146937 (std: implement `hostname`)
 - #147040 (mbe: macro_check: Fix function comments referencing non-existent parameters)
 - #147131 (Use MirPatch in simplify_branches.)
 - #147133 (Remove one loop in `extract_cfg_from_attrs`)
 - #147150 (Emit allocator attributes for allocator shim)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 967e642 into rust-lang:master Sep 30, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 30, 2025
rust-timer added a commit that referenced this pull request Sep 30, 2025
Rollup merge of #147133 - GuillaumeGomez:rm-loop-extract_cfg_from_attrs, r=lolbinarycat

Remove one loop in `extract_cfg_from_attrs`

Follow-up of #138907.

r? lolbinarycat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants