Skip to content

Refactor Type::size field to TypeId::size method for type_info#156223

Open
SpriteOvO wants to merge 2 commits intorust-lang:mainfrom
SpriteOvO:type-info-refactor-size
Open

Refactor Type::size field to TypeId::size method for type_info#156223
SpriteOvO wants to merge 2 commits intorust-lang:mainfrom
SpriteOvO:type-info-refactor-size

Conversation

@SpriteOvO
Copy link
Copy Markdown
Member

@SpriteOvO SpriteOvO commented May 6, 2026

Tracking issue #146922

r? @oli-obk

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 6, 2026

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

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@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 May 6, 2026
@SpriteOvO SpriteOvO added F-type_info #![feature(type_info)] and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 6, 2026
Comment thread compiler/rustc_const_eval/src/interpret/projection.rs
Comment thread library/core/src/mem/type_info.rs
@SpriteOvO SpriteOvO force-pushed the type-info-refactor-size branch from fa025e2 to 72d15e1 Compare May 6, 2026 05:46
@rustbot rustbot added 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 May 6, 2026
@SpriteOvO SpriteOvO added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 6, 2026
@SpriteOvO
Copy link
Copy Markdown
Member Author

image

Off-topic: Seems like a GitHub bug, when I add a label, all the other labels get removed. This is the second time it has happened, the last time was when I was triaging #155880 issue.

}

/// Equivalent to `project_downcast`, but identifies the variant by name instead of index.
pub fn project_downcast_sym<P: Projectable<'tcx, M::Provenance>>(
Copy link
Copy Markdown
Member

@RalfJung RalfJung May 6, 2026

Choose a reason for hiding this comment

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

I'd suggest calling this project_downcast_named or so. In Miri we have something similar for fields, called project_field_named, which maybe we should upstream.

View changes since the review

@oli-obk
Copy link
Copy Markdown
Contributor

oli-obk commented May 6, 2026

image

Off-topic: Seems like a GitHub bug, when I add a label, all the other labels get removed. This is the second time it has happened, the last time was when I was triaging #155880 issue.

That's a race condition with the bot adding the labels. Since they weren't there yet when you started editing, they just get reset to the removed state

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

Labels

F-type_info #![feature(type_info)] 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