-
-
Notifications
You must be signed in to change notification settings - Fork 15k
mem::transmute should be a const fn. #49450
Copy link
Copy link
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
A common request in
stdsimdis being able to initialize static variables with architecture-specific vector types.There are many ways to hack this out, but AFAICt all of them basically reduce to using an union to implement a
mem::transmuteclone whose only different frommem::transmuteis that it is aconst fn.Since this is already possible today, we should IMO just go ahead and make
mem::transmuteaconst fn.