diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-09-14 22:32:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-14 22:32:48 -0400 |
| commit | ffd286ba6ff8d1d5f2fd711f54533cdb3dd4053c (patch) | |
| tree | 9f57254d59bc2a6c216828e91c1a2a54544d5fd9 /src/libcore | |
| parent | b87e4f6421ad3015251e0162c632e25fc7c90e4e (diff) | |
| parent | 5f433577826f1cc23a83c435c8eb000075e1f79f (diff) | |
| download | rust-ffd286ba6ff8d1d5f2fd711f54533cdb3dd4053c.tar.gz rust-ffd286ba6ff8d1d5f2fd711f54533cdb3dd4053c.zip | |
Rollup merge of #44552 - durka:patch-42, r=alexcrichton
update "since" for discriminant_value It's [going](https://github.com/rust-lang/rust/pull/44263#issuecomment-329257597) to be backported to beta. r? @alexcrichton
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/mem.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index af2f876a2f3..bae1f4dee14 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -712,39 +712,39 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U { /// Opaque type representing the discriminant of an enum. /// /// See the `discriminant` function in this module for more information. -#[stable(feature = "discriminant_value", since = "1.22.0")] +#[stable(feature = "discriminant_value", since = "1.21.0")] pub struct Discriminant<T>(u64, PhantomData<*const T>); // N.B. These trait implementations cannot be derived because we don't want any bounds on T. -#[stable(feature = "discriminant_value", since = "1.22.0")] +#[stable(feature = "discriminant_value", since = "1.21.0")] impl<T> Copy for Discriminant<T> {} -#[stable(feature = "discriminant_value", since = "1.22.0")] +#[stable(feature = "discriminant_value", since = "1.21.0")] impl<T> clone::Clone for Discriminant<T> { fn clone(&self) -> Self { *self } } -#[stable(feature = "discriminant_value", since = "1.22.0")] +#[stable(feature = "discriminant_value", since = "1.21.0")] impl<T> cmp::PartialEq for Discriminant<T> { fn eq(&self, rhs: &Self) -> bool { self.0 == rhs.0 } } -#[stable(feature = "discriminant_value", since = "1.22.0")] +#[stable(feature = "discriminant_value", since = "1.21.0")] impl<T> cmp::Eq for Discriminant<T> {} -#[stable(feature = "discriminant_value", since = "1.22.0")] +#[stable(feature = "discriminant_value", since = "1.21.0")] impl<T> hash::Hash for Discriminant<T> { fn hash<H: hash::Hasher>(&self, state: &mut H) { self.0.hash(state); } } -#[stable(feature = "discriminant_value", since = "1.22.0")] +#[stable(feature = "discriminant_value", since = "1.21.0")] impl<T> fmt::Debug for Discriminant<T> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_tuple("Discriminant") @@ -777,7 +777,7 @@ impl<T> fmt::Debug for Discriminant<T> { /// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2))); /// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3))); /// ``` -#[stable(feature = "discriminant_value", since = "1.22.0")] +#[stable(feature = "discriminant_value", since = "1.21.0")] pub fn discriminant<T>(v: &T) -> Discriminant<T> { unsafe { Discriminant(intrinsics::discriminant_value(v), PhantomData) |
