Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upLower `?` to `Try` instead of `Carrier` #42275
Conversation
Mark-Simulacrum
referenced this pull request
May 28, 2017
Closed
OSX builds on Travis sometimes aren't scheduled #40672
carols10cents
assigned
nikomatsakis
May 29, 2017
carols10cents
added
the
S-waiting-on-review
label
May 29, 2017
nikomatsakis
referenced this pull request
May 30, 2017
Open
Tracking issue for `?` operator and `try` blocks (RFC 243, `question_mark` & `try_blocks` features) #31436
| @@ -0,0 +1,7 @@ | |||
| # `try_trait` | |||
|
|
|||
| The tracking issue for this feature is: [#31436] | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
scottmcm
May 31, 2017
Member
Added a bit more unstable-book text. I'm uncertain exactly what's supposed to be in it; is there anything in particular you'd like me to address there?
| /// in terms of a success/failure dichotomy. This trait allows both | ||
| /// extracting those success or failure values from an existing instance and | ||
| /// creating a new instance from a success or failure value. | ||
| #[unstable(feature = "try_trait", issue = "31436")] |
This comment has been minimized.
This comment has been minimized.
nikomatsakis
May 30, 2017
Contributor
so I also re-used #31436 as the tracking issue, but I wonder if we should make a new issue just for this feature? It would seem to make things a bit clearer e.g. when we call for FCP...
This comment has been minimized.
This comment has been minimized.
bstrie
May 30, 2017
Contributor
@nikomatsakis As policy I tend to favor making tracking issues as fine-grained as possible, specifically because of the nightmare that the original ? RFC became due to needless conflation with catch.
This comment has been minimized.
This comment has been minimized.
nikomatsakis
approved these changes
May 30, 2017
This looks good as a start! The only thing that may be worth doing is adding a bit more text into the "unstable book".
This comment has been minimized.
This comment has been minimized.
|
cc @pfpacket @peterdelevoryas -- just a heads-up that, when this lands, the (unstable) |
scottmcm
referenced this pull request
May 31, 2017
Open
Tracking issue for `ops::Try` (`try_trait` feature) #42327
scottmcm
added some commits
May 31, 2017
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
scottmcm commentedMay 28, 2017
•
edited
The easy parts of rust-lang/rfcs#1859, whose FCP completed without further comments.
Just the trait and the lowering -- neither the error message improvements nor the insta-stable impl for Option nor exhaustive docs.
Based on a github search, this will break the following:
The other results appear to be files from libcore or its tests. I could also leave Carrier around after stage0 and
impl<T:Carrier> Try for Tif that would be better.r? @nikomatsakis
Edit: Oh, and it might accidentally improve perf, based on #37939 (comment), since
Try::into_resultforResultis an obvious no-op, unlikeCarrier::translate.