@@ -754,39 +754,39 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
754754/// Opaque type representing the discriminant of an enum.
755755///
756756/// See the `discriminant` function in this module for more information.
757- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
757+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
758758pub struct Discriminant < T > ( u64 , PhantomData < * const T > ) ;
759759
760760// N.B. These trait implementations cannot be derived because we don't want any bounds on T.
761761
762- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
762+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
763763impl < T > Copy for Discriminant < T > { }
764764
765- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
765+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
766766impl < T > clone:: Clone for Discriminant < T > {
767767 fn clone ( & self ) -> Self {
768768 * self
769769 }
770770}
771771
772- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
772+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
773773impl < T > cmp:: PartialEq for Discriminant < T > {
774774 fn eq ( & self , rhs : & Self ) -> bool {
775775 self . 0 == rhs. 0
776776 }
777777}
778778
779- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
779+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
780780impl < T > cmp:: Eq for Discriminant < T > { }
781781
782- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
782+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
783783impl < T > hash:: Hash for Discriminant < T > {
784784 fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
785785 self . 0 . hash ( state) ;
786786 }
787787}
788788
789- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
789+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
790790impl < T > fmt:: Debug for Discriminant < T > {
791791 fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
792792 fmt. debug_tuple ( "Discriminant" )
@@ -811,7 +811,6 @@ impl<T> fmt::Debug for Discriminant<T> {
811811/// the actual data:
812812///
813813/// ```
814- /// #![feature(discriminant_value)]
815814/// use std::mem;
816815///
817816/// enum Foo { A(&'static str), B(i32), C(i32) }
@@ -820,7 +819,7 @@ impl<T> fmt::Debug for Discriminant<T> {
820819/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2)));
821820/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3)));
822821/// ```
823- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
822+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
824823pub fn discriminant < T > ( v : & T ) -> Discriminant < T > {
825824 unsafe {
826825 Discriminant ( intrinsics:: discriminant_value ( v) , PhantomData )
0 commit comments