Open
Description
Feature gate: #![feature(const_array_from_fn)]
This is a tracking issue for using array::from_fn
in const contexts
Public API
// core::array
pub const fn from_fn<T, const N: usize, F>(cb: F) -> [T; N]
where
F: ~const FnMut(usize) -> T + ~const Destruct,
T: ~const Destruct;
pub const fn try_from_fn<R, const N: usize, F>(cb: F) -> ChangeOutputType<R, [R::Output; N]>
where
F: ~const FnMut(usize) -> R + ~const Destruct,
R: ~const Try,
R::Residual: ~const Residual<[R::Output; N]>,
R::Output: ~const Destruct;
Steps / History
- Implementation: Constified
array::from_fn
andptr::drop_in_place
#109122 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.