-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Use const generics for array Default impl #61415
Copy link
Copy link
Open
Labels
A-arrayArea: `[T; N]`Area: `[T; N]`A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-sliceArea: `[T]`Area: `[T]`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.Libs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamT-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-arrayArea: `[T; N]`Area: `[T; N]`A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-sliceArea: `[T]`Area: `[T]`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.Libs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamT-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.
View all comments
Currently, we generate array impls for every size up to 32 manually using macros, but with const generics at a suitable level of implementation, we can switch to properly parameterising over all lengths.
Defaultimpl with const generic impl (more difficult due to Switch libcore array implementations to const generics. #60466 (comment)).rust/src/libcore/array.rs
Lines 221 to 227 in 7840a0b
rust/src/liballoc/vec.rs
Lines 2199 to 2204 in bfdfa85