Tracking issue for const Option
functions · Issue #67441 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
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:
- Tracking issue for &mut T in const contexts (const_mut_refs) #57349
- Tracking Issue for const_replace #83164
Also see the corresponding Result
tracking issue: #82814.