Skip to content

Start using comptime for reflection intrinsics and their wrapper functions#157647

Open
oli-obk wants to merge 3 commits into
rust-lang:mainfrom
oli-obk:start-using-comptime
Open

Start using comptime for reflection intrinsics and their wrapper functions#157647
oli-obk wants to merge 3 commits into
rust-lang:mainfrom
oli-obk:start-using-comptime

Conversation

@oli-obk

@oli-obk oli-obk commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

r? @fee1-dead

follow-up to #148820

I needed to add some more rustc code because turns out I forgot to add tests to the previous PR which actually codegen while using comptime fns. Check builds never try to create optimized MIR, so no code ever hit the assert that prevents creating optimized MIR for comptime fns.

@rustbot

rustbot commented Jun 9, 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, @lcnr

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@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 Jun 9, 2026
@rustbot

rustbot commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

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

@oli-obk oli-obk added the F-type_info #![feature(type_info)] label Jun 9, 2026
@rust-log-analyzer

This comment has been minimized.

/// [`FieldRepresentingType`]: crate::field::FieldRepresentingType
#[rustc_intrinsic]
#[unstable(feature = "core_intrinsics", issue = "none")]
pub const fn field_representing_type_actual_type_id(

@RalfJung RalfJung Jun 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor syntax feedback: I'd prefer if we still had the const here. The body of these functions is a const context after all, and the attribute is easy to miss. So my proposal would be that the comptime attribute should require const to be present.

View changes since the review

@oli-obk oli-obk force-pushed the start-using-comptime branch from 002b73c to b3c6e82 Compare June 9, 2026 15:25
@rustbot

rustbot commented Jun 9, 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.

@fee1-dead

Copy link
Copy Markdown
Member

LGTM
@bors r+

@rust-bors

rust-bors Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

📌 Commit b3c6e82 has been approved by fee1-dead

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 Jun 9, 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-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