Start using comptime for reflection intrinsics and their wrapper functions#157647
Open
oli-obk wants to merge 3 commits into
Open
Start using comptime for reflection intrinsics and their wrapper functions#157647oli-obk wants to merge 3 commits into
oli-obk wants to merge 3 commits into
Conversation
Collaborator
Collaborator
|
|
This comment has been minimized.
This comment has been minimized.
RalfJung
reviewed
Jun 9, 2026
| /// [`FieldRepresentingType`]: crate::field::FieldRepresentingType | ||
| #[rustc_intrinsic] | ||
| #[unstable(feature = "core_intrinsics", issue = "none")] | ||
| pub const fn field_representing_type_actual_type_id( |
Member
There was a problem hiding this comment.
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.
002b73c to
b3c6e82
Compare
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. |
Member
|
LGTM |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.