Rollup merge of #100604 - dtolnay:okorerr, r=m-ou-se

Remove unstable Result::into_ok_or_err

Pending FCP: https://github.com/rust-lang/rust/issues/82223#issuecomment-1214920203

```@rustbot``` label +waiting-on-fcp
This commit is contained in:
Yuki Okushi 2022-08-26 09:51:44 +09:00 committed by GitHub
commit ba31a9b505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 61 deletions

View file

@ -1,4 +1,5 @@
use super::{Byte, Def, Ref};
use std::ops::ControlFlow;
#[cfg(test)]
mod tests;
@ -86,17 +87,18 @@ where
F: Fn(D) -> bool,
{
match self {
Self::Seq(elts) => elts
.into_iter()
.map(|elt| elt.prune(f))
.try_fold(Tree::unit(), |elts, elt| {
Self::Seq(elts) => match elts.into_iter().map(|elt| elt.prune(f)).try_fold(
Tree::unit(),
|elts, elt| {
if elt == Tree::uninhabited() {
Err(Tree::uninhabited())
ControlFlow::Break(Tree::uninhabited())
} else {
Ok(elts.then(elt))
ControlFlow::Continue(elts.then(elt))
}
})
.into_ok_or_err(),
},
) {
ControlFlow::Break(node) | ControlFlow::Continue(node) => node,
},
Self::Alt(alts) => alts
.into_iter()
.map(|alt| alt.prune(f))

View file

@ -1,11 +1,4 @@
#![feature(
alloc_layout_extra,
control_flow_enum,
decl_macro,
iterator_try_reduce,
never_type,
result_into_ok_or_err
)]
#![feature(alloc_layout_extra, control_flow_enum, decl_macro, iterator_try_reduce, never_type)]
#![allow(dead_code, unused_variables)]
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]