Open
Description
openedon Dec 20, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Area: Constant evaluation (MIR interpretation)Area: Constant evaluation (MIR interpretation)Area: const fn foo(..) {..}. Pure functions which can be applied at compile time.Area: const fn foo(..) {..}. Pure functions which can be applied at compile time.Category: A tracking issue for an RFC or an unstable feature.Category: A tracking issue for an RFC or an unstable feature.Libs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.Relevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.Announce this issue on triage meetingAnnounce this issue on triage meeting