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:
commit
ba31a9b505
6 changed files with 11 additions and 61 deletions
|
@ -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))
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue