@@ -2144,9 +2144,10 @@ const fn expect_failed(msg: &str) -> ! {
2144
2144
/////////////////////////////////////////////////////////////////////////////
2145
2145
2146
2146
#[ 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 >
2148
2149
where
2149
- T : Clone ,
2150
+ T : ~ const Clone + ~ const Destruct ,
2150
2151
{
2151
2152
#[ inline]
2152
2153
fn clone ( & self ) -> Self {
@@ -2230,7 +2231,8 @@ impl<'a, T> IntoIterator for &'a mut Option<T> {
2230
2231
}
2231
2232
2232
2233
#[ 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 > {
2234
2236
/// Moves `val` into a new [`Some`].
2235
2237
///
2236
2238
/// # Examples
@@ -2246,7 +2248,8 @@ impl<T> From<T> for Option<T> {
2246
2248
}
2247
2249
2248
2250
#[ 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 > {
2250
2253
/// Converts from `&Option<T>` to `Option<&T>`.
2251
2254
///
2252
2255
/// # Examples
@@ -2273,7 +2276,8 @@ impl<'a, T> From<&'a Option<T>> for Option<&'a T> {
2273
2276
}
2274
2277
2275
2278
#[ 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 > {
2277
2281
/// Converts from `&mut Option<T>` to `Option<&mut T>`
2278
2282
///
2279
2283
/// # Examples
@@ -2593,7 +2597,8 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
2593
2597
}
2594
2598
2595
2599
#[ 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 > {
2597
2602
type Output = T ;
2598
2603
type Residual = Option < convert:: Infallible > ;
2599
2604
@@ -2612,9 +2617,10 @@ impl<T> ops::Try for Option<T> {
2612
2617
}
2613
2618
2614
2619
#[ unstable( feature = "try_trait_v2" , issue = "84277" , old_name = "try_trait" ) ]
2620
+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
2615
2621
// Note: manually specifying the residual type instead of using the default to work around
2616
2622
// 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 > {
2618
2624
#[ inline]
2619
2625
fn from_residual ( residual : Option < convert:: Infallible > ) -> Self {
2620
2626
match residual {
@@ -2625,15 +2631,17 @@ impl<T> ops::FromResidual<Option<convert::Infallible>> for Option<T> {
2625
2631
2626
2632
#[ diagnostic:: do_not_recommend]
2627
2633
#[ 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 > {
2629
2636
#[ inline]
2630
2637
fn from_residual ( ops:: Yeet ( ( ) ) : ops:: Yeet < ( ) > ) -> Self {
2631
2638
None
2632
2639
}
2633
2640
}
2634
2641
2635
2642
#[ 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 > {
2637
2645
type TryType = Option < T > ;
2638
2646
}
2639
2647
0 commit comments