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