Skip to content

expand: Micro-optimize prelude injection - #144587

Merged
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:optstdprel
Jul 29, 2025
Merged

expand: Micro-optimize prelude injection#144587
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:optstdprel

Conversation

@petrochenkov

Copy link
Copy Markdown
Contributor

Use splice to avoid shifting the other items twice.
Put extern crate std; first so it's already resolved when we resolve ::std::prelude::rust_20XX.

Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
@rustbot

Copy link
Copy Markdown
Collaborator

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbotrustbot 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. labels Jul 28, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

Changes to the code generated for builtin derived traits.

cc @nnethercote

@petrochenkov

Copy link
Copy Markdown
ContributorAuthor

It's probably within the noise, but let's try.
@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-borsBot added a commit that referenced this pull request Jul 28, 2025
expand: Micro-optimize prelude injection
@rust-bors

rust-borsBot commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

⌛ Trying commit c56f49d with merge 50660dc

To cancel the try build, run the command @bors try cancel.

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 28, 2025
@rust-bors

rust-borsBot commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 50660dc (50660dca656b745763302a57e270bfff7163a885, parent: 65b6cdb6a6d33987b9d642a4882283c71fbe3957)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (50660dc): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
0.0%[0.0%, 0.0%]1
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
-0.8%[-1.0%, -0.0%]7
All ❌✅ (primary)--0

Max RSS (memory usage)

Results (primary 1.3%, secondary 2.3%)

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

meanrangecount
Regressions ❌
(primary)
1.3%[1.3%, 1.3%]1
Regressions ❌
(secondary)
2.3%[2.3%, 2.3%]1
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)1.3%[1.3%, 1.3%]1

Cycles

Results (primary -2.2%, secondary -1.1%)

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

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
3.6%[3.6%, 3.6%]1
Improvements ✅
(primary)
-2.2%[-2.2%, -2.2%]1
Improvements ✅
(secondary)
-2.7%[-3.4%, -2.2%]3
All ❌✅ (primary)-2.2%[-2.2%, -2.2%]1

Binary size

Results (secondary 0.0%)

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

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
0.0%[0.0%, 0.0%]1
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)--0

Bootstrap: 468.035s -> 467.096s (-0.20%)
Artifact size: 376.82 MiB -> 376.87 MiB (0.01%)

@rustbotrustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 28, 2025
@petrochenkovpetrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 28, 2025
@nnethercote

Copy link
Copy Markdown
Contributor

Why not, it's a tiny bit cleaner, and I like the pp output more.

@bors r+

@bors

bors commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit c56f49d has been approved by nnethercote

It is now in the queue for this repository.

@borsbors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 29, 2025
@bors

bors commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

⌛ Testing commit c56f49d with merge 0410836...

bors added a commit that referenced this pull request Jul 29, 2025
expand: Micro-optimize prelude injection
Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
@bors

bors commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 29, 2025
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:01:16 --:--:-- 0
curl: (35) schannel: next InitializeSecurityContext failed: CRYPT_E_REVOCATION_OFFLINE (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.
##[error]Process completed with exit code 35.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version
git version 2.50.1.windows.1
Copying 'C:\Users\runneradmin\.gitconfig' to 'D:\a\_temp\beb53847-a574-402d-9380-f03b5d4479b3\.gitconfig'
Temporarily overriding HOME='D:\a\_temp\beb53847-a574-402d-9380-f03b5d4479b3' before making global git config changes

@petrochenkov

Copy link
Copy Markdown
ContributorAuthor

I want to check the cachegrind diff first, the perf results are a bit weird.
@rustbot author

@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 29, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@lqd

lqd commented Jul 29, 2025

Copy link
Copy Markdown
Member

I want to check the cachegrind diff first, the perf results are a bit weird.

match-stress was noisy very recently

@petrochenkov

Copy link
Copy Markdown
ContributorAuthor

r? @nnethercote
@bors r=nnethercote rollup

@bors

bors commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: Rollup of 13 pull requests #144633

@bors

bors commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit c56f49d has been approved by nnethercote

It is now in the queue for this repository.

@rustbot

Copy link
Copy Markdown
Collaborator

nnethercote is not on the review rotation at the moment.
They may take a while to respond.

@borsbors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 29, 2025
@ZalatharZalathar mentioned this pull request Jul 29, 2025
bors added a commit that referenced this pull request Jul 29, 2025
Rollup of 6 pull requests
Successful merges:
- #144560 (coverage: Treat `#[automatically_derived]` as `#[coverage(off)]`)
- #144566 (Simplify `align_of_val::<[T]>(…)` → `align_of::<T>()`)
- #144587 (expand: Micro-optimize prelude injection)
- #144589 (Account for `.yield` in illegal postfix operator message)
- #144615 (Make resolve_fn_signature responsible for its own rib.)
- #144634 (Fix typo in `DropGuard` doc)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 3d5e2fa into rust-lang:masterJul 29, 2025
11 of 12 checks passed
@rustbotrustbot added this to the 1.90.0 milestone Jul 29, 2025
rust-timer added a commit that referenced this pull request Jul 29, 2025
Rollup merge of #144587 - petrochenkov:optstdprel, r=nnethercote
expand: Micro-optimize prelude injection
Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
@petrochenkov
petrochenkov deleted the optstdprel branch June 17, 2026 14:57
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@petrochenkov@rustbot@rust-timer@nnethercote@bors@rust-log-analyzer@lqd@lcnr