New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for const Result
methods
#82814
Comments
Make Result::as_mut const Adding `const` for `Result::as_mut`. Tracking issue: rust-lang#82814
Why aren't there |
The methods probably didn't exist when this issue was created. I'll add them when I'm on my laptop. |
Could you also add |
Going through the full list now. I'm only going to be adding methods that are already stable, as the unstable methods are tracked in their associated issues. |
@pitaj Thanks. I was already subscribed to the issue, but there's nothing actionable in this tracking issue at the moment. |
What happened to |
Looks like any stuff related to constant bounds will take a considerable amount of time to be resolved. |
Feature gate:
#![feature(const_result)]
This is a tracking issue for making a number of
Result
methodsconst fn
.Public API
NB: Many of these methods will need
~const Drop
. They're omitted here for brevity.Blockers
impl const Trait for Ty
and~const
(tilde const) syntax #67792 (const_trait_impl
)ok
err
map
map_or
map_or_else
map_err
and
and_then
or
or
or_else
unwrap
unwrap_or
unwrap_or_else
expect
expect_err
copied
cloned
as_deref
&mut T
in const contexts (const_mut_refs) #57349 (const_mut_refs
)as_deref_mut
#![feature(const_precise_live_drops)]
#73255 (const_precise_live_drops
)transpose
unwrap_err_unchecked
Status
ok
Add Result::{ok, err, and, or, unwrap_or} as const #92385err
Add Result::{ok, err, and, or, unwrap_or} as const #92385as_mut
Make Result::as_mut const #89977map
map_or
map_or_else
map_err
and
Add Result::{ok, err, and, or, unwrap_or} as const #92385and_then
or
Add Result::{ok, err, and, or, unwrap_or} as const #92385or_else
unwrap_or
Add Result::{ok, err, and, or, unwrap_or} as const #92385unwrap_or_else
expect
unwrap
expect_err
unwrap_err
unwrap_or_default
as_deref
as_deref_mut
transpose
Make some Option, Result methods unstably const #82130ok
err
as_mut
map
map_or
map_or_else
map_err
and
and_then
or
or_else
unwrap_or
unwrap_or_else
expect
unwrap
expect_err
unwrap_err
unwrap_or_default
as_deref
as_deref_mut
transpose
ok
err
as_mut
map
map_or
map_or_else
map_err
and
and_then
or
or_else
unwrap_or
unwrap_or_else
expect
unwrap
expect_err
unwrap_err
unwrap_or_default
as_deref
as_deref_mut
transpose
Unresolved Questions
See also #57563.
Edit: Please ping @jhpratt if you're submitting a PR that changes any of the above! I'd like to keep the checkboxes up-to-date.
The text was updated successfully, but these errors were encountered: