-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Description
stdarch has been using rustc_legacy_const_generics since 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:
- x86/x86_64 SIMD intrinsics (SSE, AVX, AVX512, etc)
- AArch64 SIMD intrinsics
- WASM
memory_sizeandmemory_growintrinsics.
I am proposing that, until the long-term future of rustc_legacy_const_generics is decided, we only allow stabilizing new intrinsics using rustc_legacy_const_generics on targets which already use them on stable today. The rationale is that if we decide to retire rustc_legacy_const_generics in the future, the additional impact of migrating the new intrinsics will be limited since the existing intrinsics will have to be migrated anyways.