Skip to content

Remove fields from TypeKind: Struct, Enum, Union and Tuple - #161114

Open
yara-blue wants to merge 8 commits into
rust-lang:mainfrom
yara-blue:remove-typekind-fields
Open

Remove fields from TypeKind: Struct, Enum, Union and Tuple#161114
yara-blue wants to merge 8 commits into
rust-lang:mainfrom
yara-blue:remove-typekind-fields

Conversation

@yara-blue

Copy link
Copy Markdown
Contributor

Tracking issue #146922

r? @oli-obk

@rustbot

rustbot commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

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

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 CTFE machinery

cc @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 14, 2026
@rust-log-analyzer

This comment has been minimized.

@yara-blue
yara-blue force-pushed the remove-typekind-fields branch from 6295e4a to f6c1ef2 Compare August 14, 2026 23:25
Comment thread library/core/src/field.rs
// We have to use the intrinsic directly instead of through `TypeId::of` as
// that would enforce a static lifetime bound on T. As that bound is there for
// the `Eq` implementation of `TypeId` it is okay for us to work around it here.
let type_id = crate::intrinsics::type_id::<T>();

@oli-obk oli-obk Aug 15, 2026

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.

Ah forgot about that. Let's add a version of of that doesn't have a bound and is unstable with the type_info feature gate. My plan is getting rid of that bound anyway, or just having a dedicated method for it, so we can just add it now. Otherwise ppl will start having to use the intrinsic outside of libcore, too, which we wanna avoid even temporary

View changes since the review

@oli-obk oli-obk 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 Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants