View all comments
This is a tracking issue for the RFC "try_trait_v2: A new design for the ? desugaring" (rust-lang/rfcs#3058).
The feature gate for the issue is #![feature(try_trait_v2)].
This obviates rust-lang/rfcs#1859, tracked in #42327.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Unresolved Questions
From RFC:
From experience in nightly:
Implementation history
View all comments
This is a tracking issue for the RFC "
try_trait_v2: A new design for the?desugaring" (rust-lang/rfcs#3058).The feature gate for the issue is
#![feature(try_trait_v2)].This obviates rust-lang/rfcs#1859, tracked in #42327.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Delete the old way after a bootstrap updateRemove theTryV2alias #88223?desugaring #85133FromResidualbut notTryFromResidualbetter (Issue rustdoc removes Try from <Self as Try>::Residual in std::ops::FromResidual #85454)Infallibleare either fine that way or have been replaced by!Iterator::try_foldtry_foldfor iterators for internal iteration #62606)foldbe implemented in terms oftry_fold, so that both don't need to be overridden.)Unresolved Questions
From RFC:
Tryuse in the associated types/traits? Output+residual, continue+break, or something else entirely?From experience in nightly:
FromResidualfrom a type that's never actually produced as a residual (Fix the types in one of theFromResidualimplementations rwf2/Rocket#1645). But that would add more friction for cases not using theFoo<!>pattern, so may not be worth it.array::{try_from_fn, try_map}andIterator::try_findgeneric overTry#91286, that might look like changing the associatedtype Residual;totype Residual: Residual<Self::Output>;.Implementation history
try_trait_v2library basics #84092try_traitfromstdarch, Remove#![feature(try_trait)]from a test stdarch#1142try_trait_v2#84767