Tracking issue for const Option functions · Issue #67441 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@9999years

Description

@9999years

Current candidates with feature = const_option:

impl Option { pub const fn as_mut(&mut self) -> Option<&mut T>; pub const fn expect(self, msg: &str) -> T; pub const fn unwrap(self) -> T; pub const unsafe fn unwrap_unchecked(self) -> T; pub const fn take(&mut self) -> Option; pub const fn replace(&mut self, value: T) -> Option; }

impl Option<&T> { pub const fn copied(self) -> Option where T: Copy; }

impl Option<&mut T> { pub const fn copied(self) -> Option where T: Copy; }

impl<T, E> Option<Result<T, E>> { pub const fn transpose(self) -> Result<Option, E> }

impl Option<Option> { pub const fn flatten(self) -> Option; }

See also the meta-tracking issue for const fns, #57563.

Blocked on:

Also see the corresponding Result tracking issue: #82814.