Skip to content

Commit

Permalink
Rollup merge of #88223 - scottmcm:fix-alias, r=yaahc
Browse files Browse the repository at this point in the history
Remove the `TryV2` alias

Post-bootstrap-update cleanup.

(No more `try_trait_transition` feature.)
  • Loading branch information
LeSeulArtichaut authored Aug 25, 2021
2 parents f2cbbb9 + 65bfc31 commit b09c254
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
4 changes: 2 additions & 2 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2442,14 +2442,14 @@ pub trait Iterator {
R: Try<Output = bool>,
// FIXME: This bound is rather strange, but means minimal breakage on nightly.
// See #85115 for the issue tracking a holistic solution for this and try_map.
R: crate::ops::TryV2<Residual = Result<crate::convert::Infallible, E>>,
R: Try<Residual = Result<crate::convert::Infallible, E>>,
{
#[inline]
fn check<F, T, R, E>(mut f: F) -> impl FnMut((), T) -> ControlFlow<Result<T, E>>
where
F: FnMut(&T) -> R,
R: Try<Output = bool>,
R: crate::ops::TryV2<Residual = Result<crate::convert::Infallible, E>>,
R: Try<Residual = Result<crate::convert::Infallible, E>>,
{
move |(), x| match f(&x).branch() {
ControlFlow::Continue(false) => ControlFlow::CONTINUE,
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub enum ControlFlow<B, C = ()> {
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<B, C> ops::TryV2 for ControlFlow<B, C> {
impl<B, C> ops::Try for ControlFlow<B, C> {
type Output = C;
type Residual = ControlFlow<B, convert::Infallible>;

Expand Down Expand Up @@ -165,7 +165,7 @@ impl<B, C> ControlFlow<B, C> {
/// These are used only as part of implementing the iterator adapters.
/// They have mediocre names and non-obvious semantics, so aren't
/// currently on a path to potential stabilization.
impl<R: ops::TryV2> ControlFlow<R, R::Output> {
impl<R: ops::Try> ControlFlow<R, R::Output> {
/// Create a `ControlFlow` from any type implementing `Try`.
#[inline]
pub(crate) fn from_try(r: R) -> Self {
Expand Down
8 changes: 1 addition & 7 deletions library/core/src/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,7 @@ pub use self::range::{Range, RangeFrom, RangeFull, RangeTo};
pub use self::range::{Bound, RangeBounds, RangeInclusive, RangeToInclusive};

#[unstable(feature = "try_trait_v2", issue = "84277")]
pub use self::try_trait::FromResidual;

#[unstable(feature = "try_trait_v2", issue = "84277")]
pub use self::try_trait::Try;

#[unstable(feature = "try_trait_transition", reason = "for bootstrap", issue = "none")]
pub(crate) use self::try_trait::Try as TryV2;
pub use self::try_trait::{FromResidual, Try};

#[unstable(feature = "generator_trait", issue = "43122")]
pub use self::generator::{Generator, GeneratorState};
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2013,7 +2013,7 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T> ops::TryV2 for Option<T> {
impl<T> ops::Try for Option<T> {
type Output = T;
type Residual = Option<convert::Infallible>;

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> {
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T, E> ops::TryV2 for Result<T, E> {
impl<T, E> ops::Try for Result<T, E> {
type Output = T;
type Residual = Result<convert::Infallible, E>;

Expand Down
4 changes: 2 additions & 2 deletions library/core/src/task/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl<T> From<T> for Poll<T> {
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T, E> ops::TryV2 for Poll<Result<T, E>> {
impl<T, E> ops::Try for Poll<Result<T, E>> {
type Output = Poll<T>;
type Residual = Result<convert::Infallible, E>;

Expand Down Expand Up @@ -252,7 +252,7 @@ impl<T, E, F: From<E>> ops::FromResidual<Result<convert::Infallible, E>> for Pol
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T, E> ops::TryV2 for Poll<Option<Result<T, E>>> {
impl<T, E> ops::Try for Poll<Option<Result<T, E>>> {
type Output = Poll<Option<T>>;
type Residual = Result<convert::Infallible, E>;

Expand Down

0 comments on commit b09c254

Please sign in to comment.