-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Stabilize enum is_variant methods as const #76225
Copy link
Copy link
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant 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.
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant 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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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_variantmethods:Option:is_someandis_noneResult:is_okandis_errPoll:is_readyandis_pendingCow:is_borrowedandis_owned(methods themselves are unstable)IpAddr:is_ipv4andis_ipv6std::path::Prefix:is_verbatimThis 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 containsas_ref)Result: stabilized in PR#76136 (note: also containsas_ref)Pollstabilized in PR#76227Cow: methods made const in PR#76139, the methods themselves are still unstable undercow_is_borrowedIpAddr: stabilized in PR#76226Prefix: stabilization proposed in PR#76232, but there is not enough motivation to stabilize this method on its own