Skip to content

Commit aa62c5b

Browse files
committed
Fix more oopses
Thanks mbartlett21 & ehuss & tmccombs!
1 parent 05a1c41 commit aa62c5b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

text/0000-try-trait-v2.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ However, new information has come in since the previous RFC, making people wish
2929
- An [experience report](https://github.com/rust-lang/rust/issues/42327#issuecomment-366840247) in the tracking issue mentioned that it's annoying to need to make a residual type.
3030
- The `try {}` conversations have wished for more source information to flow through `?` so that fewer annotations would be required.
3131
- Similarly, it's no longer clear that `From` should be part of the `?` desugaring for _all_ types. It's both more flexible -- making inference difficult -- and more restrictive -- especially without specialization -- than is always desired.
32-
- Various library methods, such as `try_map` for arrays ([PR #79713](https://github.com/rust-lang/rust/pull/79713#issuecomment-739075171)), would like to be able to do HKT-like things to produce their result types. (For example, `Iterator::try_find` wants to be able to return a `Foo<Item>` from a predicate that returned a `Foo<bool>`.)
32+
- Various library methods, such as `try_map` for arrays ([PR #79713](https://github.com/rust-lang/rust/pull/79713#issuecomment-739075171)), would like to be able to do HKT-like things to produce their result types. (For example, `Iterator::try_find` wants to be able to return a `Foo<Option<Item>>` from a predicate that returned a `Foo<bool>`.)
3333
- Using the "error" terminology is a poor fit for other potential implementations of the trait.
3434
- It turned out that the current solution accidentally stabilized more interconversion than expected, so a more restricted form may be warranted.
3535

@@ -49,9 +49,9 @@ Why are we doing this? What use cases does it support? What is the expected outc
4949

5050
This is a simple enum:
5151
```rust
52-
struct ControlFlow<B, C = ()> {
53-
Break(B),
54-
Continue(C),
52+
enum ControlFlow<B, C = ()> {
53+
Break(B),
54+
Continue(C),
5555
}
5656
```
5757

@@ -215,8 +215,8 @@ LL | type Holder = MyResult<Infallible, U>;
215215
|
216216
::: C:\src\rust\library\core\src\ops\try.rs:102:18
217217
|
218-
LL | type Holder: BreakHolder<Self::Ok>;
219-
| --------------------- required by this bound in `std::ops::Bubble::Holder`
218+
LL | type Holder: BreakHolder<Self::Continue>;
219+
| --------------------------- required by this bound in `std::ops::Bubble::Holder`
220220
```
221221

222222
But that's a simple one:
@@ -309,7 +309,7 @@ trait Bubble {
309309
}
310310

311311
trait BreakHolder<T> {
312-
type Output: Try<Ok = T, Holder = Self>;
312+
type Output: Try<Continue = T, Holder = Self>;
313313
}
314314

315315
trait Try<H = <Self as Bubble>::Holder>: Bubble {
@@ -365,7 +365,7 @@ impl<T, E> ops::BreakHolder<T> for Result<!, E> {
365365
}
366366

367367
#[unstable(feature = "try_trait_v2", issue = "42327")]
368-
impl<T, E, F: From<E>> ops::Try2021<Result<!, E>> for Result<T, F> {
368+
impl<T, E, F: From<E>> ops::Try<Result<!, E>> for Result<T, F> {
369369
fn from_holder(x: Result<!, E>) -> Self {
370370
match x {
371371
Err(e) => Err(From::from(e)),

0 commit comments

Comments
 (0)