@@ -2144,9 +2144,10 @@ const fn expect_failed(msg: &str) -> ! {
21442144/////////////////////////////////////////////////////////////////////////////
21452145
21462146#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2147- impl < T > Clone for Option < T >
2147+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
2148+ impl < T > const Clone for Option < T >
21482149where
2149- T : Clone ,
2150+ T : ~ const Clone + ~ const Destruct ,
21502151{
21512152 #[ inline]
21522153 fn clone ( & self ) -> Self {
@@ -2230,7 +2231,8 @@ impl<'a, T> IntoIterator for &'a mut Option<T> {
22302231}
22312232
22322233#[ stable( since = "1.12.0" , feature = "option_from" ) ]
2233- impl < T > From < T > for Option < T > {
2234+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
2235+ impl < T > const From < T > for Option < T > {
22342236 /// Moves `val` into a new [`Some`].
22352237 ///
22362238 /// # Examples
@@ -2246,7 +2248,8 @@ impl<T> From<T> for Option<T> {
22462248}
22472249
22482250#[ stable( feature = "option_ref_from_ref_option" , since = "1.30.0" ) ]
2249- impl < ' a , T > From < & ' a Option < T > > for Option < & ' a T > {
2251+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
2252+ impl < ' a , T > const From < & ' a Option < T > > for Option < & ' a T > {
22502253 /// Converts from `&Option<T>` to `Option<&T>`.
22512254 ///
22522255 /// # Examples
@@ -2273,7 +2276,8 @@ impl<'a, T> From<&'a Option<T>> for Option<&'a T> {
22732276}
22742277
22752278#[ stable( feature = "option_ref_from_ref_option" , since = "1.30.0" ) ]
2276- impl < ' a , T > From < & ' a mut Option < T > > for Option < & ' a mut T > {
2279+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
2280+ impl < ' a , T > const From < & ' a mut Option < T > > for Option < & ' a mut T > {
22772281 /// Converts from `&mut Option<T>` to `Option<&mut T>`
22782282 ///
22792283 /// # Examples
@@ -2593,7 +2597,8 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
25932597}
25942598
25952599#[ unstable( feature = "try_trait_v2" , issue = "84277" , old_name = "try_trait" ) ]
2596- impl < T > ops:: Try for Option < T > {
2600+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
2601+ impl < T > const ops:: Try for Option < T > {
25972602 type Output = T ;
25982603 type Residual = Option < convert:: Infallible > ;
25992604
@@ -2612,9 +2617,10 @@ impl<T> ops::Try for Option<T> {
26122617}
26132618
26142619#[ unstable( feature = "try_trait_v2" , issue = "84277" , old_name = "try_trait" ) ]
2620+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
26152621// Note: manually specifying the residual type instead of using the default to work around
26162622// https://github.com/rust-lang/rust/issues/99940
2617- impl < T > ops:: FromResidual < Option < convert:: Infallible > > for Option < T > {
2623+ impl < T > const ops:: FromResidual < Option < convert:: Infallible > > for Option < T > {
26182624 #[ inline]
26192625 fn from_residual ( residual : Option < convert:: Infallible > ) -> Self {
26202626 match residual {
@@ -2625,15 +2631,17 @@ impl<T> ops::FromResidual<Option<convert::Infallible>> for Option<T> {
26252631
26262632#[ diagnostic:: do_not_recommend]
26272633#[ unstable( feature = "try_trait_v2_yeet" , issue = "96374" ) ]
2628- impl < T > ops:: FromResidual < ops:: Yeet < ( ) > > for Option < T > {
2634+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
2635+ impl < T > const ops:: FromResidual < ops:: Yeet < ( ) > > for Option < T > {
26292636 #[ inline]
26302637 fn from_residual ( ops:: Yeet ( ( ) ) : ops:: Yeet < ( ) > ) -> Self {
26312638 None
26322639 }
26332640}
26342641
26352642#[ unstable( feature = "try_trait_v2_residual" , issue = "91285" ) ]
2636- impl < T > ops:: Residual < T > for Option < convert:: Infallible > {
2643+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
2644+ impl < T > const ops:: Residual < T > for Option < convert:: Infallible > {
26372645 type TryType = Option < T > ;
26382646}
26392647
0 commit comments