Skip to content

Some metadata cleanups#155632

Open
nnethercote wants to merge 3 commits intorust-lang:mainfrom
nnethercote:split-Metadata
Open

Some metadata cleanups#155632
nnethercote wants to merge 3 commits intorust-lang:mainfrom
nnethercote:split-Metadata

Conversation

@nnethercote
Copy link
Copy Markdown
Contributor

Details in individual commits.

r? @mejrs

`Metadata` has two methods, `blob` and `decoder`, which are not used
together. Splitting the trait in two will allow some cleanups in
subsequent commits.
It's currently an impl for `(CrateMetadataRef, TyCtxt)`, but (a) the
`TyCtxt` is not used, and (b) the `CrateMetadataRef` can be simplified
to a `CrateMetadata` because `CStore` access isn't required. This
require changing `blob` to take `&self`, which is no big deal, and it
simplifies many `get` calls.
They are unused because of the previous commit.
@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 Apr 22, 2026
@nnethercote
Copy link
Copy Markdown
Contributor Author

I don't think this will affect perf, but let's make sure:

@bors try @rust-timer queue

@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 22, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 22, 2026
@nnethercote nnethercote marked this pull request as draft April 22, 2026 08:06
@rustbot rustbot 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 Apr 22, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 22, 2026

☀️ Try build successful (CI)
Build commit: 9f48501 (9f485017f2cce68d0c435ef64c73b05ca2658f7b, parent: 1bfcb284f7a2199ad322daa463e29e708d5bc635)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9f48501): comparison URL.

Overall result: ✅ improvements - 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

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

Max RSS (memory usage)

Results (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
Regressions ❌
(secondary)
3.8% [3.8%, 3.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-3.0%, -2.1%] 2
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 491.717s -> 508.836s (3.48%)
Artifact size: 394.44 MiB -> 394.42 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 22, 2026
@nnethercote nnethercote marked this pull request as ready for review April 22, 2026 10:34
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 22, 2026
@nnethercote
Copy link
Copy Markdown
Contributor Author

@rustbot ready

Copy link
Copy Markdown
Contributor

@mejrs mejrs left a comment

Choose a reason for hiding this comment

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

I'm not a fan of having these kind of impls for tuples, thanks for cleaning that up a bit.

@bors r+

View changes since this review

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 22, 2026

📌 Commit f0ebd66 has been approved by mejrs

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 22, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

Regarding unused tcxes in general, #149455 did something strange and added many tcxes to places where they weren't previously used.
I typically review changes to this part of the compiler, but that PR was merged long before I had time to review, unfortunately.

@nnethercote
Copy link
Copy Markdown
Contributor Author

#149455 did something strange and added many tcxes

This PR removes some of those, but not all of them.

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.

5 participants