Skip to content

Remove fields from TypeKind: Array, Slice - #161896

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
yara-blue:reflection-refactor-array-slice
Sep 8, 2026
Merged

Remove fields from TypeKind: Array, Slice#161896
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
yara-blue:reflection-refactor-array-slice

Conversation

@yara-blue

@yara-blue yara-blue commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

View all comments

Tracking issue #146922

Part of the Refactoring to many methods reflection subgoal. See that for the full context. In short for various reasons we are moving from an enum TypeKind where the variants hold the types information to one that just tells you the type kind. Separate methods on TypeId provide a way to get to the data that used to be in the variant.

r? @oli-obk

@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

The reflection data structures are tied exactly to the implementation
in the compiler. Make sure to also adjust rustc_const_eval/src/const_eval/type_info.rs

cc @oli-obk

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 27, 2026
@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

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

@oli-obk oli-obk 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.

@rust-bors

rust-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 75746ce has been approved by oli-obk

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 Sep 7, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 7, 2026
…y-slice, r=oli-obk

Remove fields from TypeKind: Array, Slice

Tracking issue rust-lang#146922

Part of the [Refactoring to many methods](https://rust-lang.zulipchat.com/#narrow/channel/572285-goals.2Freflection/topic/Refactoring.20to.20many.20methods/with/592226560) reflection subgoal. See that for the full context. In short for various reasons we are moving from an enum `TypeKind` where the variants hold the types information to one that just tells you the type kind. Separate methods on `TypeId` provide a way to get to the data that used to be in the variant.

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 7, 2026
…y-slice, r=oli-obk

Remove fields from TypeKind: Array, Slice

Tracking issue rust-lang#146922

Part of the [Refactoring to many methods](https://rust-lang.zulipchat.com/#narrow/channel/572285-goals.2Freflection/topic/Refactoring.20to.20many.20methods/with/592226560) reflection subgoal. See that for the full context. In short for various reasons we are moving from an enum `TypeKind` where the variants hold the types information to one that just tells you the type kind. Separate methods on `TypeId` provide a way to get to the data that used to be in the variant.

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 7, 2026
…y-slice, r=oli-obk

Remove fields from TypeKind: Array, Slice

Tracking issue rust-lang#146922

Part of the [Refactoring to many methods](https://rust-lang.zulipchat.com/#narrow/channel/572285-goals.2Freflection/topic/Refactoring.20to.20many.20methods/with/592226560) reflection subgoal. See that for the full context. In short for various reasons we are moving from an enum `TypeKind` where the variants hold the types information to one that just tells you the type kind. Separate methods on `TypeId` provide a way to get to the data that used to be in the variant.

r? @oli-obk
rust-bors Bot pushed a commit that referenced this pull request Sep 7, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - #161896 (Remove fields from TypeKind: Array, Slice)
 - #162354 (Make comptime functions ineligible for coverage)
 - #162379 (add test ensuring we refuse to const-eval the body of a rustc_do_not_const_check function)

Failed merges:

 - #162294 (Reflection refactor ptrs)
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=test-armhf-gnu

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 7, 2026
…<try>

Remove fields from TypeKind: Array, Slice


try-job: test-armhf-gnu
@JonathanBrouwer

JonathanBrouwer commented Sep 7, 2026

Copy link
Copy Markdown
Member

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #162417 (comment)

Most likely this PR but not 100% sure, therefore starting try job

@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 7, 2026
@rust-bors

rust-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#162417), which was unapproved.

View changes since this unapproval

@yara-blue

Copy link
Copy Markdown
Contributor Author

Most likely this PR but not 100% sure, therefore starting try job

I'm 95% sure it is :3

Fix is on the way, should I try build after?

@JonathanBrouwer

Copy link
Copy Markdown
Member

Yes please
@bors delegate=try

@rust-bors

rust-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

✌️ @yara-blue, you can now perform try builds on this pull request!

Warning

You used the legacy format of the delegate command.
The new format is @bors delegate[=<username>] [<try|review>].

You can now post @bors try to start a try build.

@rust-bors

rust-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

💔 Test for bd65654 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@yara-blue
yara-blue force-pushed the reflection-refactor-array-slice branch from 75746ce to 86729db Compare September 7, 2026 13:27
@yara-blue

Copy link
Copy Markdown
Contributor Author

@bors try jobs=test-armhf-gnu

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 7, 2026
…<try>

Remove fields from TypeKind: Array, Slice


try-job: test-armhf-gnu
@rust-bors

rust-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6136c36 (6136c36c624ceef2235f781619dfbd8b50397c6a)
Base parent: 656a9da (656a9da186dacaf3bf8f7f7296a825d256cb4ae3)

@yara-blue

Copy link
Copy Markdown
Contributor Author

@JonathanBrouwer This one passes now, the code unintentionally assumed an int to always be 64 bit, that's fixed now 🥳

Should be good for another rollup

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r=oli-obk

@rust-bors

rust-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 86729db has been approved by oli-obk

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

This comment has been minimized.

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 7, 2026
@yara-blue
yara-blue force-pushed the reflection-refactor-array-slice branch from 86729db to ed8f8b6 Compare September 7, 2026 19:23
@rustbot

rustbot commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r=oli-obk

@rust-bors

rust-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ed8f8b6 has been approved by oli-obk

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 7, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 7, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #162436 (Replace links to `github.com/rust-lang/rfcs` with links to the Rust RFC Book)
 - #162438 (codegen_llvm: use minimum/maximum intrinsics now that they got fixed)
 - #161896 (Remove fields from TypeKind: Array, Slice)
 - #162276 (Avoid wrong suggestions for never type coerce)
 - #162421 (Raise a delayed bug when comparing incompatible constructors)
@rust-bors
rust-bors Bot merged commit 501a26c into rust-lang:main Sep 8, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 8, 2026
Rollup merge of #161896 - yara-blue:reflection-refactor-array-slice, r=oli-obk

Remove fields from TypeKind: Array, Slice

Tracking issue #146922

Part of the [Refactoring to many methods](https://rust-lang.zulipchat.com/#narrow/channel/572285-goals.2Freflection/topic/Refactoring.20to.20many.20methods/with/592226560) reflection subgoal. See that for the full context. In short for various reasons we are moving from an enum `TypeKind` where the variants hold the types information to one that just tells you the type kind. Separate methods on `TypeId` provide a way to get to the data that used to be in the variant.

r? @oli-obk
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. T-libs Relevant to the library 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