@@ -359,11 +359,20 @@ where
359359/// and in the other direction,
360360/// `<Result<Infallible, E> as Residual<T>>::TryType = Result<T, E>`.
361361#[ unstable( feature = "try_trait_v2_residual" , issue = "91285" ) ]
362- #[ rustc_const_unstable( feature = "const_try " , issue = "74935 " ) ]
363- pub const trait Residual <O > {
362+ #[ rustc_const_unstable( feature = "const_try_residual " , issue = "91285 " ) ]
363+ pub const trait Residual <O >: Sized {
364364 /// The "return" type of this meta-function.
365365 #[ unstable( feature = "try_trait_v2_residual" , issue = "91285" ) ]
366- type TryType : Try < Output = O , Residual = Self > ;
366+ type TryType : [ const ] Try < Output = O , Residual = Self > ;
367+
368+ /// Here for convenience in the `?` desugaring.
369+ /// Probably should not be stabilized, as it should never be overridden.
370+ /// (without a `final fn` of some form, cc RFC#3678)
371+ #[ unstable ( feature = "try_trait_v2_residual" , issue = "91285" ) ]
372+ #[ lang = "into_try_type" ]
373+ fn into_try_type ( self ) -> Self :: TryType {
374+ FromResidual : : from_residual ( self )
375+ }
367376}
368377
369378#[ unstable ( feature = "pub_crate_should_not_need_unstable_attr" , issue = "none" ) ]
0 commit comments