@@ -754,39 +754,39 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
754
754
/// Opaque type representing the discriminant of an enum.
755
755
///
756
756
/// 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 " ) ]
758
758
pub struct Discriminant < T > ( u64 , PhantomData < * const T > ) ;
759
759
760
760
// N.B. These trait implementations cannot be derived because we don't want any bounds on T.
761
761
762
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
762
+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
763
763
impl < T > Copy for Discriminant < T > { }
764
764
765
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
765
+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
766
766
impl < T > clone:: Clone for Discriminant < T > {
767
767
fn clone ( & self ) -> Self {
768
768
* self
769
769
}
770
770
}
771
771
772
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
772
+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
773
773
impl < T > cmp:: PartialEq for Discriminant < T > {
774
774
fn eq ( & self , rhs : & Self ) -> bool {
775
775
self . 0 == rhs. 0
776
776
}
777
777
}
778
778
779
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
779
+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
780
780
impl < T > cmp:: Eq for Discriminant < T > { }
781
781
782
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
782
+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
783
783
impl < T > hash:: Hash for Discriminant < T > {
784
784
fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
785
785
self . 0 . hash ( state) ;
786
786
}
787
787
}
788
788
789
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
789
+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
790
790
impl < T > fmt:: Debug for Discriminant < T > {
791
791
fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
792
792
fmt. debug_tuple ( "Discriminant" )
@@ -811,7 +811,6 @@ impl<T> fmt::Debug for Discriminant<T> {
811
811
/// the actual data:
812
812
///
813
813
/// ```
814
- /// #![feature(discriminant_value)]
815
814
/// use std::mem;
816
815
///
817
816
/// enum Foo { A(&'static str), B(i32), C(i32) }
@@ -820,7 +819,7 @@ impl<T> fmt::Debug for Discriminant<T> {
820
819
/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2)));
821
820
/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3)));
822
821
/// ```
823
- #[ unstable ( feature = "discriminant_value" , reason = "recently added, follows RFC" , issue = "24263 ") ]
822
+ #[ stable ( feature = "discriminant_value" , since = "1.21.0 " ) ]
824
823
pub fn discriminant < T > ( v : & T ) -> Discriminant < T > {
825
824
unsafe {
826
825
Discriminant ( intrinsics:: discriminant_value ( v) , PhantomData )
0 commit comments