Skip to content

Some metadata cleanups#155632

Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
nnethercote:split-Metadata
Apr 22, 2026
Merged

Some metadata cleanups#155632
rust-bors[bot] merged 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.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors rollup
This can be rolled up, no perf effect

rust-bors Bot pushed a commit that referenced this pull request Apr 22, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #154794 (Add on_unmatch_args)
 - #155133 (Document precision considerations of `Duration`-float methods)
 - #154283 (Remove `nodes_in_current_session` field and related assertions)
 - #155374 (rustdoc: fix a few spots where emit isn't respected)
 - #155587 (Immediately feed visibility on DefId creation)
 - #155622 (c-variadic: `va_arg` fixes )
 - #155629 (rustc_public: Add `constness` & `asyncness` in `FnDef`)
 - #155632 (Some metadata cleanups)
 - #155639 (BinOpAssign always returns unit)
 - #155647 (rustc-dev-guide subtree update)
@rust-bors rust-bors Bot merged commit 6f6e6bb into rust-lang:main Apr 22, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 22, 2026
rust-timer added a commit that referenced this pull request Apr 22, 2026
Rollup merge of #155632 - nnethercote:split-Metadata, r=mejrs

Some metadata cleanups

Details in individual commits.

r? @mejrs
@nnethercote nnethercote deleted the split-Metadata branch April 22, 2026 22:43
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 24, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#154794 (Add on_unmatch_args)
 - rust-lang/rust#155133 (Document precision considerations of `Duration`-float methods)
 - rust-lang/rust#154283 (Remove `nodes_in_current_session` field and related assertions)
 - rust-lang/rust#155374 (rustdoc: fix a few spots where emit isn't respected)
 - rust-lang/rust#155587 (Immediately feed visibility on DefId creation)
 - rust-lang/rust#155622 (c-variadic: `va_arg` fixes )
 - rust-lang/rust#155629 (rustc_public: Add `constness` & `asyncness` in `FnDef`)
 - rust-lang/rust#155632 (Some metadata cleanups)
 - rust-lang/rust#155639 (BinOpAssign always returns unit)
 - rust-lang/rust#155647 (rustc-dev-guide subtree update)
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