Require that a <_ as Try>::Residual implement the Residual trait#154451
Require that a <_ as Try>::Residual implement the Residual trait#154451scottmcm wants to merge 1 commit intorust-lang:mainfrom
<_ as Try>::Residual implement the Residual trait#154451Conversation
| /// "foo-ness" of the residual so other types need to opt-in to interconversion. | ||
| #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] | ||
| type Residual; | ||
| type Residual: Residual<Self::Output>; |
There was a problem hiding this comment.
There's a more nuanced conversation about whether this should go further and also require
| type Residual: Residual<Self::Output>; | |
| type Residual: Residual<Self::Output, TryType = Self>; |
but that has a variety of implications, so I'd rather leave it for another time rather than this PR.
This comment has been minimized.
This comment has been minimized.
d1b48a0 to
0dcf324
Compare
This comment has been minimized.
This comment has been minimized.
The `Residual` trait was even more experimental than `Try`, but now that RFC3721 is merged, I think it would make sense to require this.
0dcf324 to
898972a
Compare
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
rustbot has assigned @petrochenkov. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? library |
|
Failed to set assignee to
|
|
r? libs |
|
cc @rust-lang/libs-api
|
The
Residualtrait was even more experimental thanTry, but now that rust-lang/rfcs#3721 is merged, I think it would make sense to require this. Technically it's not strictly required, but without it something working on<T: Try>might need an extra bound even to use a homogeneous try block with the same output type asT::Output. (Anotherwherewill of course be needed to return a differentimpl Trytype still.)cc #154391