Skip to content

Simplify try_load_from_disk_fn.#155080

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
nnethercote:salvage
Apr 10, 2026
Merged

Simplify try_load_from_disk_fn.#155080
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
nnethercote:salvage

Conversation

@nnethercote
Copy link
Copy Markdown
Contributor

try_load_from_disk_fn has a single call site. We can move some of the stuff within it to its single call site, which simplifies it, and also results in all of the query profiling code ending up in the same module. Details in individual commits.

r? @Zalathar

It doesn't need to be in there, it can instead be at the single call
site. Removing it eliminates one parameter, makes `define_queries!`
smaller (which is always good), and also enables the next commit which
tidies up profiling.

This commit also changes how `value` and `verify` are initialized,
because I don't like the current way of doing it after the declaration.
From `plumbing.rs` to `execution.rs`, which is where most of the other
query profiling occurs. It also avoids eliminates some fn parameters.

This means the `provided_to_erased` call in `try_from_load_disk_fn` is
now included in the profiling when previously it wasn't. This is
good because `provided_to_erased` is included in other profiling calls
(e.g. calls to `invoke_provider_fn`).
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Apr 10, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 10, 2026

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

@nnethercote
Copy link
Copy Markdown
Contributor Author

I did this in two commits but it might be easier to review by looking at "Files changed" because of the way the second commit builds on the first.

@nnethercote
Copy link
Copy Markdown
Contributor Author

I have been informed that @Zalathar is busy with other things right now, let's try a different reviewer.

r? @petrochenkov

@rustbot rustbot assigned petrochenkov and unassigned Zalathar Apr 10, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

📌 Commit 4fb83f6 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Apr 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 10, 2026
Simplify `try_load_from_disk_fn`.

`try_load_from_disk_fn` has a single call site. We can move some of the stuff within it to its single call site, which simplifies it, and also results in all of the query profiling code ending up in the same module. Details in individual commits.

r? @Zalathar
@Kobzol
Copy link
Copy Markdown
Member

Kobzol commented Apr 10, 2026

@bors try @rust-timer queue

Just in case :)

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 10, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 10, 2026
Simplify `try_load_from_disk_fn`.
rust-bors bot pushed a commit that referenced this pull request Apr 10, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #155047 (Always exhaustively match on typing mode)
 - #155080 (Simplify `try_load_from_disk_fn`.)
 - #152384 (Restrict EII declarations to functions at lowering time)
 - #153796 (Fix ICE when combining #[eii] with #[core::contracts::ensures])
 - #154369 (Fix `pattern_from_macro_note` for bit-or expr)
 - #155027 ( Rename some more of our internal `#[rustc_*]` TEST attributes)
 - #155031 (delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition)
 - #155040 (Fix code block whitespace handling in Markdown)
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

☀️ Try build successful (CI)
Build commit: 03c75e8 (03c75e82d41afd03186fd0c93517bbc04912a597, parent: 25a54d4ba87873ef02ef0e5fce49baa57198deb3)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (03c75e8): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never
@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 0.2%, secondary -2.4%)

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

mean range count
Regressions ❌
(primary)
2.9% [2.9%, 2.9%] 1
Regressions ❌
(secondary)
1.5% [1.5%, 1.5%] 1
Improvements ✅
(primary)
-2.5% [-2.5%, -2.5%] 1
Improvements ✅
(secondary)
-6.4% [-6.4%, -6.4%] 1
All ❌✅ (primary) 0.2% [-2.5%, 2.9%] 2

Cycles

Results (primary -0.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)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) -0.4% [-2.9%, 2.2%] 2

Binary size

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

Bootstrap: 488.4s -> 488.788s (0.08%)
Artifact size: 395.55 MiB -> 395.54 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 10, 2026
@Kobzol
Copy link
Copy Markdown
Member

Kobzol commented Apr 10, 2026

@bors rollup=maybe

@rust-bors rust-bors bot merged commit 79a4c77 into rust-lang:main Apr 10, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 10, 2026
rust-timer added a commit that referenced this pull request Apr 10, 2026
Rollup merge of #155080 - nnethercote:salvage, r=petrochenkov

Simplify `try_load_from_disk_fn`.

`try_load_from_disk_fn` has a single call site. We can move some of the stuff within it to its single call site, which simplifies it, and also results in all of the query profiling code ending up in the same module. Details in individual commits.

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

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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