Skip to content

Tracking Issue for constifying Result methods that depend on const traits #144281

@clarfonthey

Description

@clarfonthey

Feature gate: #![feature(const_result_traits)]

This is a tracking issue for constifying the methods of Result that depend on const traits. (#143874)

Public API

impl<T, E> Result<T, E> {
    const fn map<F, U>(self, f: F) -> Result<U, E> where F: [const] FnOnce(T) -> U + [const] Destruct;
    const fn map<O, F>(self, op: O) -> Result<T, F> where O: [const] FnOnce(E) -> F + [const] Destruct;
    const fn inspect<F>(self, f: F) -> Result<T, E> where F: [const] FnOnce(&T) + [const] Destruct;
    const fn inspect_err<F>(self, f: F) -> Result<T, E> where F: [const] FnOnce(&E) + [const] Destruct;
    const fn as_deref(&self) -> Result<&T::Target, &E> where T: [const] Deref;
    const fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> where T: [const] DerefMut;
}

Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

  • Implementation: TBD
  • Final comment period (FCP)1
  • Stabilization PR

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions