Skip to content

Tracking issue for const Option functions #67441

Closed
@9999years

Description

@9999years
Contributor

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:

Also see the corresponding Result tracking issue: #82814.

Activity

added
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
on Dec 20, 2019
added
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Dec 20, 2019
added 2 commits that reference this issue on Jul 17, 2020

Rollup merge of rust-lang#73930 - a1phyr:feature_const_option, r=dtolnay

7a8cea7

Rollup merge of rust-lang#73930 - a1phyr:feature_const_option, r=dtolnay

f6cd31c
added
Libs-TrackedLibs issues that are tracked on the team's project board.
on Jul 30, 2020
added a commit that references this issue on Jul 31, 2020

Auto merge of rust-lang#74956 - ecstatic-morse:const-option-unwrap, r…

added a commit that references this issue on Sep 19, 2020

Rollup merge of rust-lang#76135 - CDirkx:const-option, r=dtolnay

af0594f

96 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @CodesInChaos@RalfJung@oli-obk@Centril@davidhewitt

      Issue actions

        Tracking issue for const `Option` functions · Issue #67441 · rust-lang/rust