Tracking issue for const Option
functions · Issue #67441 · rust-lang/rust
Navigation Menu
- [GitHub Copilot
Write better code with AI](https://github.com/features/copilot)
- [GitHub Copilot
[GitHub Advanced Security
Find and fix vulnerabilities](https://github.com/security/advanced-security)[Actions
Automate any workflow](https://github.com/features/actions)[Codespaces
Instant dev environments](https://github.com/features/codespaces)[Issues
Plan and track work](https://github.com/features/issues)[Code Review
Manage code changes](https://github.com/features/code-review)[Discussions
Collaborate outside of code](https://github.com/features/discussions)[Code Search
Find more, search less](https://github.com/features/code-search)Explore
- [GitHub Sponsors
Fund open source developers](https://github.com/sponsors)
- [GitHub Sponsors
[The ReadME Project
GitHub community articles](https://github.com/readme)- [Enterprise platform
AI-powered developer platform](https://github.com/enterprise)
- [Enterprise platform
Use saved searches to filter your results more quickly
Description
Current candidates with feature = const_option
:
impl<T> Option<T> {
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<T>;
pub const fn replace(&mut self, value: T) -> Option<T>;
}
impl<T> Option<&T> {
pub const fn copied(self) -> Option<T>
where
T: Copy;
}
impl<T> Option<&mut T> {
pub const fn copied(self) -> Option<T>
where
T: Copy;
}
impl<T, E> Option<Result<T, E>> {
pub const fn transpose(self) -> Result<Option<T>, E>
}
impl<T> Option<Option<T>> {
pub const fn flatten(self) -> Option<T>;
}
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.