From 65bfc3130a782464d301c85b3edcbed5732b8a52 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 21 Aug 2021 15:09:03 -0700 Subject: [PATCH] Remove the `TryV2` alias Post-bootstrap-update cleanup. --- library/core/src/iter/traits/iterator.rs | 4 ++-- library/core/src/ops/control_flow.rs | 4 ++-- library/core/src/ops/mod.rs | 8 +------- library/core/src/option.rs | 2 +- library/core/src/result.rs | 2 +- library/core/src/task/poll.rs | 4 ++-- 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index 524d8f857e2a5..75987d18fe00e 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -2442,14 +2442,14 @@ pub trait Iterator { R: Try, // 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>, + R: Try>, { #[inline] fn check(mut f: F) -> impl FnMut((), T) -> ControlFlow> where F: FnMut(&T) -> R, R: Try, - R: crate::ops::TryV2>, + R: Try>, { move |(), x| match f(&x).branch() { ControlFlow::Continue(false) => ControlFlow::CONTINUE, diff --git a/library/core/src/ops/control_flow.rs b/library/core/src/ops/control_flow.rs index c2270c864dfae..cd2d57699c92c 100644 --- a/library/core/src/ops/control_flow.rs +++ b/library/core/src/ops/control_flow.rs @@ -63,7 +63,7 @@ pub enum ControlFlow { } #[unstable(feature = "try_trait_v2", issue = "84277")] -impl ops::TryV2 for ControlFlow { +impl ops::Try for ControlFlow { type Output = C; type Residual = ControlFlow; @@ -165,7 +165,7 @@ impl ControlFlow { /// 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 ControlFlow { +impl ControlFlow { /// Create a `ControlFlow` from any type implementing `Try`. #[inline] pub(crate) fn from_try(r: R) -> Self { diff --git a/library/core/src/ops/mod.rs b/library/core/src/ops/mod.rs index 85e04740d96a4..bd7feb8b183ce 100644 --- a/library/core/src/ops/mod.rs +++ b/library/core/src/ops/mod.rs @@ -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}; diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 78f5954532ff0..47865240f6a6f 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -2013,7 +2013,7 @@ impl> FromIterator> for Option { } #[unstable(feature = "try_trait_v2", issue = "84277")] -impl ops::TryV2 for Option { +impl ops::Try for Option { type Output = T; type Residual = Option; diff --git a/library/core/src/result.rs b/library/core/src/result.rs index 861790e8a4099..092e6544342b7 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -1889,7 +1889,7 @@ impl> FromIterator> for Result { } #[unstable(feature = "try_trait_v2", issue = "84277")] -impl ops::TryV2 for Result { +impl ops::Try for Result { type Output = T; type Residual = Result; diff --git a/library/core/src/task/poll.rs b/library/core/src/task/poll.rs index fc0a4e747973a..2507046099632 100644 --- a/library/core/src/task/poll.rs +++ b/library/core/src/task/poll.rs @@ -222,7 +222,7 @@ impl From for Poll { } #[unstable(feature = "try_trait_v2", issue = "84277")] -impl ops::TryV2 for Poll> { +impl ops::Try for Poll> { type Output = Poll; type Residual = Result; @@ -252,7 +252,7 @@ impl> ops::FromResidual> for Pol } #[unstable(feature = "try_trait_v2", issue = "84277")] -impl ops::TryV2 for Poll>> { +impl ops::Try for Poll>> { type Output = Poll>; type Residual = Result;