-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Policy on the use of rustc_legacy_const_generics in stdarch #149654
Copy link
Copy link
Open
Labels
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.T-langRelevant to the language teamRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Metadata
Metadata
Assignees
Labels
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.T-langRelevant to the language teamRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
stdarch has been using
rustc_legacy_const_genericssince 2021 (#83167) to allow some functions to accept const generics in argument position. However there have been concerns that the implementation of this feature is a hack, which has recently caused problems (#130443), and it's unclear whether we want to keep this feature in the long run (#146613).However, many stdarch intrinsics for x86 and ARM targets are stable and depend on this feature. Addtionally, we are in the process of stabilizing more intrinsics in these architectures which rely on
rustc_legacy_const_generics(#127213).Specifically, these stable intrinsics use
rustc_legacy_const_generics:memory_sizeandmemory_growintrinsics.I am proposing that, until the long-term future of
rustc_legacy_const_genericsis decided, we only allow stabilizing new intrinsics usingrustc_legacy_const_genericson targets which already use them on stable today (except WASM, which has minimal use today). The rationale is that if we decide to retirerustc_legacy_const_genericsin the future, the additional impact of migrating the new intrinsics will be limited since the existing intrinsics will have to be migrated anyways.