Skip to content

Conversation

@SpriteOvO
Copy link
Member

@SpriteOvO SpriteOvO commented Jan 14, 2026

Tracking issue: #146922 #![feature(type_info)]

This PR supports ADT types for feature type_info reflection.
(It's still a draft PR, with implementation in progress)

Note that this PR does not take SemVer into consideration (I left a FIXME comment). As discussed earlier (comment), this requires further discussion. However, I hope we could get an initial implementation to land first, so we can start playing with it.

Progress / Checklist

  • Struct support.
  • Enum
  • Union
  • Generics
  • Methods Implemented and to be implemented in other PRs
  • Traits Implemented and to be implemented in other PRs
  • Rebasing PR to main branch
    (It's currently based on PR Support primitives in type info reflection #151123, so here's an extra commit)
  • Cleanup and Rebase.
  • Fix field info for references. (see comment)

r? @oli-obk

@SpriteOvO SpriteOvO added A-type-system Area: Type system F-type_info #![feature(type_info)] labels Jan 14, 2026
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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 Jan 14, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2026

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

@SpriteOvO SpriteOvO changed the title Support primitives in type info reflection Support ADT types in type info reflection Jan 14, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@9SonSteroids
Copy link

Is there anything missing from this PR / is there some way I could help? @SpriteOvO

@SpriteOvO
Copy link
Member Author

I've almost finished it locally, but there's still some cleanup and rebasing I need to do before it's ready for review. Just been a bit busy lately.

@9SonSteroids
Copy link

@SpriteOvO Btw traits are already done in the other PR and unions / methods seem out of scope of ADTs so consider omiting them from this PR

@SpriteOvO SpriteOvO force-pushed the type-info-adt branch 2 times, most recently from c5e6c84 to f0ae098 Compare February 7, 2026 17:22
@rust-log-analyzer

This comment has been minimized.

@SpriteOvO SpriteOvO marked this pull request as ready for review February 7, 2026 18:43
@rustbot
Copy link
Collaborator

rustbot commented Feb 7, 2026

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

@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 Feb 7, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

📌 Commit 6ab6734 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 Feb 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
Support ADT types in type info reflection

Tracking issue: rust-lang#146922 `#![feature(type_info)]`

This PR supports ADT types for feature `type_info` reflection.
(It's still a draft PR, with implementation in progress)

Note that this PR does not take SemVer into consideration (I left a FIXME comment). As discussed earlier ([comment](rust-lang#146923 (comment))), this requires further discussion. However, I hope we could get an initial implementation to land first, so we can start playing with it.

### Progress / Checklist

- [x] Struct support.
- [x] Enum
- [x] Union
- [x] Generics
- [ ] ~Methods~ Implemented and to be implemented in other PRs
- [ ] ~Traits~ Implemented and to be implemented in other PRs
- [x] Rebasing PR to `main` branch
  ~~(It's currently based on PR rust-lang#151123, so here's an extra commit)~~
- [x] Cleanup and Rebase.
- [x] Fix field info for references. (see [comment](rust-lang#151142 (comment)))

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
Support ADT types in type info reflection

Tracking issue: rust-lang#146922 `#![feature(type_info)]`

This PR supports ADT types for feature `type_info` reflection.
(It's still a draft PR, with implementation in progress)

Note that this PR does not take SemVer into consideration (I left a FIXME comment). As discussed earlier ([comment](rust-lang#146923 (comment))), this requires further discussion. However, I hope we could get an initial implementation to land first, so we can start playing with it.

### Progress / Checklist

- [x] Struct support.
- [x] Enum
- [x] Union
- [x] Generics
- [ ] ~Methods~ Implemented and to be implemented in other PRs
- [ ] ~Traits~ Implemented and to be implemented in other PRs
- [x] Rebasing PR to `main` branch
  ~~(It's currently based on PR rust-lang#151123, so here's an extra commit)~~
- [x] Cleanup and Rebase.
- [x] Fix field info for references. (see [comment](rust-lang#151142 (comment)))

r? @oli-obk
rust-bors bot pushed a commit that referenced this pull request Feb 10, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #149937 (try enabling `linker-messages` by default again)
 - #151733 (Use function shims to make sure EII works on apple targets)
 - #152120 (Don't ICE on layout error in vtable computation)
 - #152419 (Move more query system code)
 - #152431 (Restrict the set of things that const stability can be applied to)
 - #152436 (Reenable a GCI+mGCA+GCPT test case)
 - #151142 (Support ADT types in type info reflection)
 - #152021 (Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2)
 - #152146 (mGCA: Add associated const type check)
 - #152372 (style: remove unneeded trailing commas)
 - #152383 (BikeshedGuaranteedNoDrop trait: add comments indicating that it can be observed on stable)
 - #152397 (Update books)
 - #152441 (Fix typos and grammar in top-level and src/doc documentation)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 10, 2026
Support ADT types in type info reflection

Tracking issue: rust-lang#146922 `#![feature(type_info)]`

This PR supports ADT types for feature `type_info` reflection.
(It's still a draft PR, with implementation in progress)

Note that this PR does not take SemVer into consideration (I left a FIXME comment). As discussed earlier ([comment](rust-lang#146923 (comment))), this requires further discussion. However, I hope we could get an initial implementation to land first, so we can start playing with it.

### Progress / Checklist

- [x] Struct support.
- [x] Enum
- [x] Union
- [x] Generics
- [ ] ~Methods~ Implemented and to be implemented in other PRs
- [ ] ~Traits~ Implemented and to be implemented in other PRs
- [x] Rebasing PR to `main` branch
  ~~(It's currently based on PR rust-lang#151123, so here's an extra commit)~~
- [x] Cleanup and Rebase.
- [x] Fix field info for references. (see [comment](rust-lang#151142 (comment)))

r? @oli-obk
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2026
Support ADT types in type info reflection

Tracking issue: rust-lang#146922 `#![feature(type_info)]`

This PR supports ADT types for feature `type_info` reflection.
(It's still a draft PR, with implementation in progress)

Note that this PR does not take SemVer into consideration (I left a FIXME comment). As discussed earlier ([comment](rust-lang#146923 (comment))), this requires further discussion. However, I hope we could get an initial implementation to land first, so we can start playing with it.

### Progress / Checklist

- [x] Struct support.
- [x] Enum
- [x] Union
- [x] Generics
- [ ] ~Methods~ Implemented and to be implemented in other PRs
- [ ] ~Traits~ Implemented and to be implemented in other PRs
- [x] Rebasing PR to `main` branch
  ~~(It's currently based on PR rust-lang#151123, so here's an extra commit)~~
- [x] Cleanup and Rebase.
- [x] Fix field info for references. (see [comment](rust-lang#151142 (comment)))

r? @oli-obk
@matthiaskrgr
Copy link
Member

@bors r-
#152473 (comment)

@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 Feb 11, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 11, 2026

Commit 6ab6734 has been unapproved.

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

@SpriteOvO
Copy link
Member Author

@oli-obk I think we should probably drop the dump.rs test? Even though we now separate bit32 and bit64 output results, struct size is starting to differ across architectures.

I'll confirm later whether a follow-up PR is necessary to further refine the existing type_info.rs coretest, ensuring we cover all current outputs even without dump.rs.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 11, 2026

Yea. dump.rs was never a good idea I had. Just an easy thing. There's enough other tests, so let's nuke it

@SpriteOvO
Copy link
Member Author

@rustbot review

@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 Feb 11, 2026
@oli-obk
Copy link
Contributor

oli-obk commented Feb 11, 2026

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 11, 2026

📌 Commit 4810270 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 Feb 11, 2026
Urgau added a commit to Urgau/rust that referenced this pull request Feb 11, 2026
Support ADT types in type info reflection

Tracking issue: rust-lang#146922 `#![feature(type_info)]`

This PR supports ADT types for feature `type_info` reflection.
(It's still a draft PR, with implementation in progress)

Note that this PR does not take SemVer into consideration (I left a FIXME comment). As discussed earlier ([comment](rust-lang#146923 (comment))), this requires further discussion. However, I hope we could get an initial implementation to land first, so we can start playing with it.

### Progress / Checklist

- [x] Struct support.
- [x] Enum
- [x] Union
- [x] Generics
- [ ] ~Methods~ Implemented and to be implemented in other PRs
- [ ] ~Traits~ Implemented and to be implemented in other PRs
- [x] Rebasing PR to `main` branch
  ~~(It's currently based on PR rust-lang#151123, so here's an extra commit)~~
- [x] Cleanup and Rebase.
- [x] Fix field info for references. (see [comment](rust-lang#151142 (comment)))

r? @oli-obk
rust-bors bot pushed a commit that referenced this pull request Feb 12, 2026
Rollup of 7 pull requests

Successful merges:

 - #152505 (Sync relnotes for stable 1.93.1)
 - #137487 (Stabilize `assert_matches`)
 - #152281 (borrowck: suggest `&mut *x` for pattern reborrows)
 - #151142 (Support ADT types in type info reflection)
 - #152477 (rustc-dev-guide subtree update)
 - #152488 (allow `deprecated(since = "CURRENT_RUSTC_VERSION")`)
 - #152491 (Remove unused `fluent-syntax` dependency from tidy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-type-system Area: Type system F-type_info #![feature(type_info)] 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.

6 participants