@@ -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
- #[ stable( feature = "discriminant_value" , since = "1.22 .0" ) ]
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
- #[ stable( feature = "discriminant_value" , since = "1.22 .0" ) ]
762
+ #[ stable( feature = "discriminant_value" , since = "1.21 .0" ) ]
763
763
impl < T > Copy for Discriminant < T > { }
764
764
765
- #[ stable( feature = "discriminant_value" , since = "1.22 .0" ) ]
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
- #[ stable( feature = "discriminant_value" , since = "1.22 .0" ) ]
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
- #[ stable( feature = "discriminant_value" , since = "1.22 .0" ) ]
779
+ #[ stable( feature = "discriminant_value" , since = "1.21 .0" ) ]
780
780
impl < T > cmp:: Eq for Discriminant < T > { }
781
781
782
- #[ stable( feature = "discriminant_value" , since = "1.22 .0" ) ]
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
- #[ stable( feature = "discriminant_value" , since = "1.22 .0" ) ]
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" )
@@ -819,7 +819,7 @@ impl<T> fmt::Debug for Discriminant<T> {
819
819
/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2)));
820
820
/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3)));
821
821
/// ```
822
- #[ stable( feature = "discriminant_value" , since = "1.22 .0" ) ]
822
+ #[ stable( feature = "discriminant_value" , since = "1.21 .0" ) ]
823
823
pub fn discriminant < T > ( v : & T ) -> Discriminant < T > {
824
824
unsafe {
825
825
Discriminant ( intrinsics:: discriminant_value ( v) , PhantomData )
0 commit comments