-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
try{}: What does homogeneity mean for Poll? #155368
Copy link
Copy link
Open
Labels
F-try_blocks`#![feature(try_blocks)]``#![feature(try_blocks)]`F-try_trait_v2Tracking issue for RFC#3058Tracking issue for RFC#3058T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.
Metadata
Metadata
Assignees
Labels
F-try_blocks`#![feature(try_blocks)]``#![feature(try_blocks)]`F-try_trait_v2Tracking issue for RFC#3058Tracking issue for RFC#3058T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The idea of rust-lang/rfcs#3721 is that you get "the same" thing out of
try { x? }.However, there's currently no requirement that that actually happen in either the trait nor the desugaring.
As usual,
Pollis the problem child for this: https://doc.rust-lang.org/std/task/enum.Poll.html#impl-Try-for-Poll%3COption%3CResult%3CT,+E%3E%3E%3ESome potential options:
type Residual: Residual<Self::Output, TryType = Self>;to theTrytrait so that this can't happen any more.Pollto be distinct, and to update theFromResidualimplementations accordingly to continue to support stable things.try { my_poll? }will give aResultor anOption.?ortry {somehow that would enforce that it's usable only onTrytypes with full homogeneitywherebounds