@@ -41,8 +41,7 @@ use crate::ops::ControlFlow;
41
41
/// output type that we want:
42
42
/// ```
43
43
/// # #![feature(try_trait_v2)]
44
- /// # #![feature(try_trait_transition)]
45
- /// # use std::ops::TryV2 as Try;
44
+ /// # use std::ops::Try;
46
45
/// fn simple_try_fold_1<A, T, R: Try<Output = A>>(
47
46
/// iter: impl Iterator<Item = T>,
48
47
/// mut accum: A,
@@ -56,9 +55,8 @@ use crate::ops::ControlFlow;
56
55
/// into the return type using [`Try::from_output`]:
57
56
/// ```
58
57
/// # #![feature(try_trait_v2)]
59
- /// # #![feature(try_trait_transition)]
60
58
/// # #![feature(control_flow_enum)]
61
- /// # use std::ops::{ControlFlow, TryV2 as Try};
59
+ /// # use std::ops::{ControlFlow, Try};
62
60
/// fn simple_try_fold_2<A, T, R: Try<Output = A>>(
63
61
/// iter: impl Iterator<Item = T>,
64
62
/// mut accum: A,
@@ -81,9 +79,8 @@ use crate::ops::ControlFlow;
81
79
/// recreated from their corresponding residual, so we'll just call it:
82
80
/// ```
83
81
/// # #![feature(try_trait_v2)]
84
- /// # #![feature(try_trait_transition)]
85
82
/// # #![feature(control_flow_enum)]
86
- /// # use std::ops::{ControlFlow, TryV2 as Try};
83
+ /// # use std::ops::{ControlFlow, Try};
87
84
/// pub fn simple_try_fold_3<A, T, R: Try<Output = A>>(
88
85
/// iter: impl Iterator<Item = T>,
89
86
/// mut accum: A,
@@ -103,10 +100,9 @@ use crate::ops::ControlFlow;
103
100
/// But this "call `branch`, then `match` on it, and `return` if it was a
104
101
/// `Break`" is exactly what happens inside the `?` operator. So rather than
105
102
/// do all this manually, we can just use `?` instead:
106
- /// ```compile_fail (enable again once ? converts to the new trait)
103
+ /// ```
107
104
/// # #![feature(try_trait_v2)]
108
- /// # #![feature(try_trait_transition)]
109
- /// # use std::ops::TryV2 as Try;
105
+ /// # use std::ops::Try;
110
106
/// fn simple_try_fold<A, T, R: Try<Output = A>>(
111
107
/// iter: impl Iterator<Item = T>,
112
108
/// mut accum: A,
@@ -160,8 +156,7 @@ pub trait Try: FromResidual {
160
156
/// ```
161
157
/// #![feature(try_trait_v2)]
162
158
/// #![feature(control_flow_enum)]
163
- /// #![feature(try_trait_transition)]
164
- /// use std::ops::TryV2 as Try;
159
+ /// use std::ops::Try;
165
160
///
166
161
/// assert_eq!(<Result<_, String> as Try>::from_output(3), Ok(3));
167
162
/// assert_eq!(<Option<_> as Try>::from_output(4), Some(4));
@@ -193,8 +188,7 @@ pub trait Try: FromResidual {
193
188
/// ```
194
189
/// #![feature(try_trait_v2)]
195
190
/// #![feature(control_flow_enum)]
196
- /// #![feature(try_trait_transition)]
197
- /// use std::ops::{ControlFlow, TryV2 as Try};
191
+ /// use std::ops::{ControlFlow, Try};
198
192
///
199
193
/// assert_eq!(Ok::<_, String>(3).branch(), ControlFlow::Continue(3));
200
194
/// assert_eq!(Err::<String, _>(3).branch(), ControlFlow::Break(Err(3)));
0 commit comments