Feature gates: #![feature(const_array_from_ref)] and #![feature(const_slice_from_ref)]
This is a tracking issue for {array, slice}::{from_ref, from_mut} functions marked as const fn
Public API
This feature makes the following APIs const:
// core::array
pub const fn from_mut<T>(s: &mut T) -> &mut [T; 1];
// core::slice
pub const fn from_mut<T>(s: &mut T) -> &mut [T];
These functions as const were previously tracked here, but are now stabilized:
// core::array
pub const fn from_ref<T>(s: &T) -> &[T; 1];
// core::slice
pub const fn from_ref<T>(s: &T) -> &[T];
Steps / History
Unresolved Questions
Feature gates:
#![feature(const_array_from_ref)]and#![feature(const_slice_from_ref)]This is a tracking issue for
{array, slice}::{from_ref, from_mut}functions marked as const fnPublic API
This feature makes the following APIs
const:These functions as
constwere previously tracked here, but are now stabilized:Steps / History
{array, slice}::{from_ref, from_mut}as const fn #90162_reffunctions: Stabilize{slice,array}::from_ref#97366Unresolved Questions