@@ -711,39 +711,39 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
711711/// Opaque type representing the discriminant of an enum.
712712///
713713/// 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 " ) ]
715715pub struct Discriminant < T > ( u64 , PhantomData < * const T > ) ;
716716
717717// N.B. These trait implementations cannot be derived because we don't want any bounds on T.
718718
719- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
719+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
720720impl < T > Copy for Discriminant < T > { }
721721
722- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
722+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
723723impl < T > clone:: Clone for Discriminant < T > {
724724 fn clone ( & self ) -> Self {
725725 * self
726726 }
727727}
728728
729- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
729+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
730730impl < T > cmp:: PartialEq for Discriminant < T > {
731731 fn eq ( & self , rhs : & Self ) -> bool {
732732 self . 0 == rhs. 0
733733 }
734734}
735735
736- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
736+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
737737impl < T > cmp:: Eq for Discriminant < T > { }
738738
739- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
739+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
740740impl < T > hash:: Hash for Discriminant < T > {
741741 fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
742742 self . 0 . hash ( state) ;
743743 }
744744}
745745
746- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
746+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
747747impl < T > fmt:: Debug for Discriminant < T > {
748748 fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
749749 fmt. debug_tuple ( "Discriminant" )
@@ -768,7 +768,6 @@ impl<T> fmt::Debug for Discriminant<T> {
768768/// the actual data:
769769///
770770/// ```
771- /// #![feature(discriminant_value)]
772771/// use std::mem;
773772///
774773/// enum Foo { A(&'static str), B(i32), C(i32) }
@@ -777,7 +776,7 @@ impl<T> fmt::Debug for Discriminant<T> {
777776/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2)));
778777/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3)));
779778/// ```
780- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
779+ #[ stable ( feature = "discriminant_value" , since = "1.22.0 " ) ]
781780pub fn discriminant < T > ( v : & T ) -> Discriminant < T > {
782781 unsafe {
783782 Discriminant ( intrinsics:: discriminant_value ( v) , PhantomData )
0 commit comments