-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Stabilize enum is_variant
methods as const
#76225
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Comments
This was referenced Sep 1, 2020
These were all the instances of enums with PRs opened for all of them, @ecstatic-morse |
RalfJung
added a commit
to RalfJung/rust
that referenced
this issue
Sep 19, 2020
Stabilize some Option methods as const Stabilize the following methods of `Option` as const: - `is_some` - `is_none` - `as_ref` These methods are currently const under the unstable feature `const_option` (tracking issue: rust-lang#67441). I believe these methods to be eligible for stabilization because of the stabilization of rust-lang#49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](rust-lang#75463). Related: rust-lang#76225
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 20, 2020
Stabilize some Result methods as const Stabilize the following methods of Result as const: - `is_ok` - `is_err` - `as_ref` A test is also included, analogous to the test for `const_option`. These methods are currently const under the unstable feature `const_result` (tracking issue: rust-lang#67520). I believe these methods to be eligible for stabilization because of the stabilization of rust-lang#49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](rust-lang#75463) and [PR#76135](rust-lang#76135). Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature. Related: rust-lang#76225
RalfJung
added a commit
to RalfJung/rust
that referenced
this issue
Sep 21, 2020
Stabilize some Option methods as const Stabilize the following methods of `Option` as const: - `is_some` - `is_none` - `as_ref` These methods are currently const under the unstable feature `const_option` (tracking issue: rust-lang#67441). I believe these methods to be eligible for stabilization because of the stabilization of rust-lang#49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](rust-lang#75463). Related: rust-lang#76225
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Sep 24, 2020
Stabilize some Result methods as const Stabilize the following methods of Result as const: - `is_ok` - `is_err` - `as_ref` A test is also included, analogous to the test for `const_option`. These methods are currently const under the unstable feature `const_result` (tracking issue: rust-lang#67520). I believe these methods to be eligible for stabilization because of the stabilization of rust-lang#49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](rust-lang#75463) and [PR#76135](rust-lang#76135). Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature. Related: rust-lang#76225
m-ou-se
added a commit
to m-ou-se/rust
that referenced
this issue
Nov 7, 2020
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
m-ou-se
added a commit
to m-ou-se/rust
that referenced
this issue
Nov 7, 2020
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
m-ou-se
added a commit
to m-ou-se/rust
that referenced
this issue
Nov 7, 2020
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
m-ou-se
added a commit
to m-ou-se/rust
that referenced
this issue
Nov 7, 2020
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Nov 8, 2020
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
m-ou-se
added a commit
to m-ou-se/rust
that referenced
this issue
Nov 8, 2020
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 23, 2020
Stabilize `IpAddr::is_ipv4` and `is_ipv6` as const Insta-stabilize the methods `is_ipv4` and `is_ipv6` of `std::net::IpAddr` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225 and rust-lang#76205.
Closing as all |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
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
andis_none
Result
:is_ok
andis_err
Poll
:is_ready
andis_pending
Cow
:is_borrowed
andis_owned
(methods themselves are unstable)IpAddr
:is_ipv4
andis_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 containsas_ref
)Result
: stabilized in PR#76136 (note: also containsas_ref
)Poll
stabilized in PR#76227Cow
: methods made const in PR#76139, the methods themselves are still unstable undercow_is_borrowed
IpAddr
: stabilized in PR#76226Prefix
: stabilization proposed in PR#76232, but there is not enough motivation to stabilize this method on its ownThe text was updated successfully, but these errors were encountered: