@@ -711,39 +711,39 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
711
711
/// Opaque type representing the discriminant of an enum.
712
712
///
713
713
/// See the `discriminant` function in this module for more information.
714
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
714
+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
715
715
pub struct Discriminant < T > ( u64 , PhantomData < * const T > ) ;
716
716
717
717
// N.B. These trait implementations cannot be derived because we don't want any bounds on T.
718
718
719
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
719
+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
720
720
impl < T > Copy for Discriminant < T > { }
721
721
722
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
722
+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
723
723
impl < T > clone:: Clone for Discriminant < T > {
724
724
fn clone ( & self ) -> Self {
725
725
* self
726
726
}
727
727
}
728
728
729
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
729
+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
730
730
impl < T > cmp:: PartialEq for Discriminant < T > {
731
731
fn eq ( & self , rhs : & Self ) -> bool {
732
732
self . 0 == rhs. 0
733
733
}
734
734
}
735
735
736
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
736
+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
737
737
impl < T > cmp:: Eq for Discriminant < T > { }
738
738
739
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
739
+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
740
740
impl < T > hash:: Hash for Discriminant < T > {
741
741
fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
742
742
self . 0 . hash ( state) ;
743
743
}
744
744
}
745
745
746
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
746
+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
747
747
impl < T > fmt:: Debug for Discriminant < T > {
748
748
fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
749
749
fmt. debug_tuple ( "Discriminant" )
@@ -768,7 +768,6 @@ impl<T> fmt::Debug for Discriminant<T> {
768
768
/// the actual data:
769
769
///
770
770
/// ```
771
- /// #![feature(discriminant_value)]
772
771
/// use std::mem;
773
772
///
774
773
/// enum Foo { A(&'static str), B(i32), C(i32) }
@@ -777,7 +776,7 @@ impl<T> fmt::Debug for Discriminant<T> {
777
776
/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2)));
778
777
/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3)));
779
778
/// ```
780
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
779
+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
781
780
pub fn discriminant < T > ( v : & T ) -> Discriminant < T > {
782
781
unsafe {
783
782
Discriminant ( intrinsics:: discriminant_value ( v) , PhantomData )
0 commit comments