Skip to content

Stabilize enum is_variant methods as const #76225

Description

@CDirkx

Recently const control flow was stabilized, which enables a lot of methods within the standard library to be made stable const; specifically all of the enum is_variant methods:

  • Option: is_some and is_none
  • Result: is_ok and is_err
  • Poll: is_ready and is_pending
  • Cow: is_borrowed and is_owned (methods themselves are unstable)
  • IpAddr: is_ipv4 and is_ipv6
  • std::path::Prefix: is_verbatim

This issue aims to collect discussion about the stabilization of these methods, due to their similarities and trivial implementations.

Stabilization

  • Option: stabilized in PR#76135 (note: also contains as_ref)
  • Result: stabilized in PR#76136 (note: also contains as_ref)
  • Poll stabilized in PR#76227
  • Cow: methods made const in PR#76139, the methods themselves are still unstable under cow_is_borrowed
  • IpAddr: stabilized in PR#76226
  • Prefix: stabilization proposed in PR#76232, but there is not enough motivation to stabilize this method on its own

Activity

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-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions