Skip to content

borrowck: Simplify deps to build compiler 30s faster - #160358

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
joshtriplett:borrowck-simplify-deps
Aug 2, 2026
Merged

borrowck: Simplify deps to build compiler 30s faster#160358
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
joshtriplett:borrowck-simplify-deps

Conversation

@joshtriplett

Copy link
Copy Markdown
Member

rustc_borrowck uses two helpers from rustc_traits. One of them is re-exported from rustc_trait_selection, and the other can easily move to rustc_trait_selection.

Making rustc_borrowck use these helpers from rustc_trait_selection directly, and eliminating the rustc_traits dependency, allows starting to build rustc_borrowck earlier, which substantially speeds up building the compiler because rustc_borrowck is one of the last things to build.

On my system, this speeds up the rustc build by a little over 30s.

… it from there

`rustc_borrowck` uses `type_op_prove_predicate_with_cause` from
`rustc_traits`, but is a simple helper that can live in
`rustc_trait_selection` instead. Move it there.
@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. labels Aug 1, 2026
@rustbot

rustbot commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, types
  • compiler, types expanded to 75 candidates
  • Random selection from 18 candidates

@rust-log-analyzer

This comment has been minimized.

`rustc_borrowck` now only uses `rustc_traits` for one helper that it
re-exports from `rustc_trait_selection`. Use the helper directly from
`rustc_trait_selection`, and eliminate the dependency.
@joshtriplett
joshtriplett force-pushed the borrowck-simplify-deps branch from 33ec3dd to 425c312 Compare August 1, 2026 23:06
@rustbot

rustbot commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@mejrs

mejrs commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 2, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 2, 2026
borrowck: Simplify deps to build compiler 30s faster
@rust-bors

rust-bors Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f1bf412 (f1bf412ba34726c72fd27fb00f7b35c908c57318)
Base parent: 73dc916 (73dc9167f1cd099e525c9ade2e068d1907b78564)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f1bf412): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary 3.4%, secondary 0.5%)

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

mean range count
Regressions ❌
(primary)
3.4% [0.5%, 6.4%] 2
Regressions ❌
(secondary)
0.5% [0.4%, 0.6%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [0.5%, 6.4%] 2

Cycles

Results (primary 0.1%, 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.7% [0.5%, 1.1%] 5
Regressions ❌
(secondary)
0.7% [0.5%, 1.0%] 6
Improvements ✅
(primary)
-0.7% [-0.9%, -0.6%] 4
Improvements ✅
(secondary)
-2.1% [-2.9%, -1.0%] 4
All ❌✅ (primary) 0.1% [-0.9%, 1.1%] 9

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.553s -> 487.967s (-0.53%)
Artifact size: 390.33 MiB -> 390.35 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 2, 2026
@joshtriplett

Copy link
Copy Markdown
Member Author

AIUI, the perf suite bootstrap timing uses -j1, so it isn't picking up on improvements that primarily help builds with higher parallelism. This was a 30s improvement on my system with -j12.

@mejrs mejrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It'll also be very nice for people making changes to rustc_traits :)

r? me @bors r+

View changes since this review

@rust-bors

rust-bors Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 425c312 has been approved by mejrs

It is now in the queue for this repository.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 2, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 2, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 2, 2026
…s, r=mejrs

borrowck: Simplify deps to build compiler 30s faster

`rustc_borrowck` uses two helpers from `rustc_traits`. One of them is re-exported from `rustc_trait_selection`, and the other can easily move to `rustc_trait_selection`.

Making `rustc_borrowck` use these helpers from `rustc_trait_selection` directly, and eliminating the `rustc_traits` dependency, allows starting to build `rustc_borrowck` earlier, which substantially speeds up building the compiler because `rustc_borrowck` is one of the last things to build.

On my system, this speeds up the rustc build by a little over 30s.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 2, 2026
…s, r=mejrs

borrowck: Simplify deps to build compiler 30s faster

`rustc_borrowck` uses two helpers from `rustc_traits`. One of them is re-exported from `rustc_trait_selection`, and the other can easily move to `rustc_trait_selection`.

Making `rustc_borrowck` use these helpers from `rustc_trait_selection` directly, and eliminating the `rustc_traits` dependency, allows starting to build `rustc_borrowck` earlier, which substantially speeds up building the compiler because `rustc_borrowck` is one of the last things to build.

On my system, this speeds up the rustc build by a little over 30s.
rust-bors Bot pushed a commit that referenced this pull request Aug 2, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #159906 (Semantic check of `mut` restrictions)
 - #160358 (borrowck: Simplify deps to build compiler 30s faster)
 - #160375 (miri subtree update)
 - #159499 (tests: prefer max-llvm-major-version over open LLVM ranges)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 2, 2026
…s, r=mejrs

borrowck: Simplify deps to build compiler 30s faster

`rustc_borrowck` uses two helpers from `rustc_traits`. One of them is re-exported from `rustc_trait_selection`, and the other can easily move to `rustc_trait_selection`.

Making `rustc_borrowck` use these helpers from `rustc_trait_selection` directly, and eliminating the `rustc_traits` dependency, allows starting to build `rustc_borrowck` earlier, which substantially speeds up building the compiler because `rustc_borrowck` is one of the last things to build.

On my system, this speeds up the rustc build by a little over 30s.
rust-bors Bot pushed a commit that referenced this pull request Aug 2, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #159906 (Semantic check of `mut` restrictions)
 - #156527 (Move `std::io` tests to `alloctests` & add prelude)
 - #159525 (Stabilize passing 128-bit integers via vector registers with `asm!` on x86)
 - #160342 (Specialize `advance_by` method of `Fuse`)
 - #160358 (borrowck: Simplify deps to build compiler 30s faster)
 - #160375 (miri subtree update)
 - #106643 (Allow only implementing `Read::read_buf`)
 - #159499 (tests: prefer max-llvm-major-version over open LLVM ranges)
 - #159729 (allocations are allowed to grow (but not shrink))
 - #159881 (fix: Do not stop `visible_parent_map` breadth-first search reaching children of `#[doc(hidden)]` modules)
 - #160189 (Move codegen_stmt_debuginfo to debuginfo.rs)
 - #160356 (Add more tests for `must_implement_one_of`)
@rust-bors
rust-bors Bot merged commit 81ad376 into rust-lang:main Aug 2, 2026
14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 2, 2026
rust-timer added a commit that referenced this pull request Aug 2, 2026
Rollup merge of #160358 - joshtriplett:borrowck-simplify-deps, r=mejrs

borrowck: Simplify deps to build compiler 30s faster

`rustc_borrowck` uses two helpers from `rustc_traits`. One of them is re-exported from `rustc_trait_selection`, and the other can easily move to `rustc_trait_selection`.

Making `rustc_borrowck` use these helpers from `rustc_trait_selection` directly, and eliminating the `rustc_traits` dependency, allows starting to build `rustc_borrowck` earlier, which substantially speeds up building the compiler because `rustc_borrowck` is one of the last things to build.

On my system, this speeds up the rustc build by a little over 30s.
@joshtriplett
joshtriplett deleted the borrowck-simplify-deps branch August 3, 2026 19:47
WhySoBad pushed a commit to WhySoBad/miri that referenced this pull request Aug 5, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#159906 (Semantic check of `mut` restrictions)
 - rust-lang/rust#156527 (Move `std::io` tests to `alloctests` & add prelude)
 - rust-lang/rust#159525 (Stabilize passing 128-bit integers via vector registers with `asm!` on x86)
 - rust-lang/rust#160342 (Specialize `advance_by` method of `Fuse`)
 - rust-lang/rust#160358 (borrowck: Simplify deps to build compiler 30s faster)
 - rust-lang/rust#160375 (miri subtree update)
 - rust-lang/rust#106643 (Allow only implementing `Read::read_buf`)
 - rust-lang/rust#159499 (tests: prefer max-llvm-major-version over open LLVM ranges)
 - rust-lang/rust#159729 (allocations are allowed to grow (but not shrink))
 - rust-lang/rust#159881 (fix: Do not stop `visible_parent_map` breadth-first search reaching children of `#[doc(hidden)]` modules)
 - rust-lang/rust#160189 (Move codegen_stmt_debuginfo to debuginfo.rs)
 - rust-lang/rust#160356 (Add more tests for `must_implement_one_of`)
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-compiler Relevant 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.

6 participants