Repository navigation
Proof of Concept: enforced homogeneity for Try (& Poll) - #163637
Draft
MusicalNinjaDad wants to merge 9 commits into
Draft
MusicalNinjaDad wants to merge 9 commits into
MusicalNinjaDad wants to merge 9 commits into
Conversation
MusicalNinjaDad
force-pushed
the
try_poll
branch
from
October 3, 2026 06:23
aa05e45 to
a82da97
Compare
This comment has been minimized.
This comment has been minimized.
MusicalNinjaDad
force-pushed
the
try_poll
branch
from
October 3, 2026 06:35
a82da97 to
e8af9c3
Compare
This comment has been minimized.
This comment has been minimized.
MusicalNinjaDad
force-pushed
the
try_poll
branch
2 times, most recently
from
October 3, 2026 10:20
e8af9c3 to
4a64637
Compare
This comment has been minimized.
This comment has been minimized.
MusicalNinjaDad
force-pushed
the
try_poll
branch
from
October 3, 2026 14:50
9021ab3 to
17983e5
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
MusicalNinjaDad
force-pushed
the
try_poll
branch
from
October 5, 2026 10:41
ae9da4a to
9bce5a8
Compare
This comment has been minimized.
This comment has been minimized.
traits with associated lang items
MusicalNinjaDad
force-pushed
the
try_poll
branch
from
October 5, 2026 11:03
9bce5a8 to
e9d0fe5
Compare
This comment has been minimized.
This comment has been minimized.
MusicalNinjaDad
force-pushed
the
try_poll
branch
from
October 5, 2026 12:14
e9d0fe5 to
a17f464
Compare
This comment has been minimized.
This comment has been minimized.
MusicalNinjaDad
force-pushed
the
try_poll
branch
from
October 5, 2026 13:42
a17f464 to
bd3608a
Compare
This comment has been minimized.
This comment has been minimized.
MusicalNinjaDad
force-pushed
the
try_poll
branch
from
October 5, 2026 15:01
bd3608a to
9fa6156
Compare
This comment has been minimized.
This comment has been minimized.
Member
|
@bors try |
This comment has been minimized.
This comment has been minimized.
Contributor
FIXME this needs to be reverted and done properly if the overall approach is sound
try_fold is stable but relies on unstable trait Try. add a dedicated qmark! macro which performs future desugaring in a stable context. This is sound because only stdlib can name and use Try in a stable context. All third-party implementations of try_fold must be unstable and make use of feature(try_trait_v2) in order to name Try. This does not introduce any new risks, any adjustments to unstable `Try` already need to consider the impact on try_fold. All other try_xxx methods in stdlib are unstable.
to explicitly use modern desugaring
to use qmark! get_or_try_insert_with is currently unstable and is the only such method which relies on `?`. All other unstable `try_xxx` methods manually implement a match on Try::branch.
This reverts commit 0f9e216.
MusicalNinjaDad
force-pushed
the
try_poll
branch
from
October 6, 2026 07:20
9fa6156 to
9d3e7b5
Compare
Contributor
Author
|
r? @tmandry can you please set up a crater run for this. Thanks! |
Member
|
@bors try |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 6, 2026
Proof of Concept: enforced homogeneity for Try (& Poll)
Contributor
Member
|
@craterbot run mode=check-only start=8d1a76430406c877b35d0b627e7f796dcf0dfeca+rustflags=-Aunfulfilled-lint-expectations end=8773d2c75a8e90130dcce745a7ec4e66bb9963db+rustflags=-Aunfulfilled-lint-expectations
|
Collaborator
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
Contributor
|
☔ The latest upstream changes (presumably #164005) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
View all comments
This is a draft PR targeted at a crater run to validate the viability of enforcing homogeneity for
Try. See #155368, #84277 & rust-lang/goals#654.If successful, this will feed into a near-future design meeting on the key open points for stabilising
Try. I will organise a design meeting once the crater results are available.Requesting a crater run to validate the following points
homogeneous
PollThis is not expected to produce any regressions in stable code.
?desugaring has been gated to use non-homogeneousPollunlessfeature(try_trait_v2)is enabled. See zulip: #t-lang/try > impl Try for std::task::Poll for more details & discussion.Iterator::try_foldPotential source of regression, low risk.
try_foldis currently stable and names the unstabletrait Tryin its signature, this means that gated?desugaring cannot be leveraged. There is a potential for crater regressions in the case thattry_foldis used on an iterator ofPoll<Result<_,_>orPoll<Option<Result<_,_>>; I cannot conceive a viable use-case for doing this as it would require silently ignoring & throwing away anyPending/Ready(None)cases during folding.enforced homogeneity
This is not expected to produce any regressions in stable code.
Only stdlib can name
Tryetc in stable code.x testpasses locally, any regressions should be caught by the full CI test run & bors build before crater.TODOs - this is a draft PR for the following reasons
Tryis fixed to an edition boundary. All unstabletry_...features should not stabilise beforetry_trait_v2try_trait_v2flagged as unused if only needed for desugaringLLM statement
Confirmed no LLM usage.