You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tracking Issue for constifying Result methods that drop values #92384
This is a tracking issue for the const_result_drop feature, which includes constness for the following methods:
impl<T,E>Result<T,E>{// will drop errorpubconstfnok(self) -> Option<T>whereE: ~constDrop;// will drop okpubconstfnerr(self) -> Option<E>whereT: ~constDrop;// will drop error or the argumentpubconstfnand<U>(self,res:Result<U,E>) -> Result<U,E>whereT: ~constDrop,U: ~constDrop,E: ~constDrop;// will drop ok or the argumentpubconstfnor<F>(self,res:Result<T,F>) -> Result<T,F>whereT: ~constDrop,E: ~constDrop,F: ~constDrop;// will drop error or the argumentpubconstfnunwrap_or(self,default:T) -> TwhereT: ~constDrop,E: ~constDrop;}
Note that these depend on the semantics for ~const Drop, which is (probably) tracked in #67792.
changed the title [-]Tracking Issue for `const_result_option`[/-][+]Tracking Issue for constifying `Result` methods that drop values[/+]on Jan 29, 2022
At least when I created it, it was not intended to be a meta issue. Result::as_mut, Result::transpose, and Result::flatten point directly to that as their tracking issue.
Activity
clarfonthey commentedon Dec 29, 2021
Turns out you actually can't make these const, at least for now. So, closing.
clarfonthey commentedon Dec 29, 2021
Reopened now that I've found a proper way to do this. Linked the tracking issue for
~constsince this depends on the semantics of~const Drop.[-]Tracking Issue for `const_result_option`[/-][+]Tracking Issue for constifying `Result` methods that drop values[/+]Rollup merge of rust-lang#92385 - clarfonthey:const_option, r=fee1-dead
Rollup merge of rust-lang#92385 - clarfonthey:const_option, r=fee1-dead
Rollup merge of rust-lang#92385 - clarfonthey:const_option, r=fee1-dead
Rollup merge of rust-lang#92385 - clarfonthey:const_option, r=fee1-dead
jhpratt commentedon Mar 17, 2022
Duplicate of #82814?
clarfonthey commentedon Mar 17, 2022
That appears to be a meta tracking issue, this is specifically for these methods.
jhpratt commentedon Mar 17, 2022
At least when I created it, it was not intended to be a meta issue.
Result::as_mut,Result::transpose, andResult::flattenpoint directly to that as their tracking issue.clarfonthey commentedon Mar 17, 2022
Yes, but for now, these methods point to this one, since they presumably would need their own FCP.
jhpratt commentedon Mar 17, 2022
I figured it would be a partial stabilization of #82814. Not a big deal either way, just wanted to bring it to your attention 🙂
RalfJung commentedon Sep 8, 2024
This got removed by #110393.