-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Decide about future of rustc_legacy_const_generics #146613
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-nominatedNominated for discussion during a lang team meeting.Nominated for discussion during a lang team meeting.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.P-lang-drag-3Lang team prioritization drag level 3.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang.Lang team prioritization drag level 3.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang.T-langRelevant to the language teamRelevant to the language team
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-nominatedNominated for discussion during a lang team meeting.Nominated for discussion during a lang team meeting.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.P-lang-drag-3Lang team prioritization drag level 3.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang.Lang team prioritization drag level 3.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Back in 2021, we converted stdarch intrinsics to use const generics:
However, we seem to have left open the question of how strongly we want to deprecate
rustc_legacy_const_genericsand whether it's appropriate to userustc_legacy_const_genericson new APIs.Following guidance (in #83167 (comment)) related to the experience for people on older MSRVs, our documentation still points people toward this "legacy" syntax (e.g.).
On the other hand, we recently made this legacy syntax significantly less functional than the const generic equivalent in:
Our discussion on that proceeded as follows (2024-10-30):
For my part, I had taken from our decision and discussion that we mean to phase out as much as possible of what relies on the current implementation and concept of
rustc_legacy_const_genericswhile at the same time being open to proposals for how we might approach this in a more appealing way. However, given the open questions we had left in 2021, it seems less clear to me now what our plan is.Perhaps without noticing, we recently stabilized the AVX512 intrinsics with
rustc_legacy_const_generics:@RalfJung has proposed that, maybe, as this only went out in Rust 1.89, we could see about clawing this back. Conversely, there's a proposal, for consistently, to extend
rustc_legacy_const_genericsto all intrinsics with const generic parameters:#[rustc_legacy_const_generics]to all intrinsics with const-generic parameters stdarch#1916What do we want to do? The questions for us include:
rustc_legacy_const_genericsbe applied to new APIs? If not, should we mark it as "deprecated"?rustc_legacy_const_genericsbe applied to existing APIs for consistency?rustc_legacy_const_genericsfrom AVX512 intrinsics?rustc_legacy_const_genericsover an edition?cc @RalfJung @BoxyUwU @Amanieu @sayantn @rust-lang/project-const-generics @rust-lang/wg-const-eval @rust-lang/lang