-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Description
Proposal
Problem statement
Allow using <[[T; N]]>::flatten
within const fn
.
Motivation, use-cases
Could be useful for code like this where you have an array containing arrays (for instance from u32::to_be_bytes
) to return an array. For example, Ipv6Addr::new
in standard library could make use of it.
[f(a), f(b), f(c), f(d)].flatten().try_into().unwrap()
Solution sketches
Add const
keyword. The current implementation is already const-compatible, and I don't see a reason why this would change.
Links and related work
What happens now?
This issue is part of the libs-api team API change proposal process. Once this issue is filed the libs-api team will review open proposals in its weekly meeting. You should receive feedback within a week or two.
Metadata
Metadata
Assignees
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries