diff options
| author | Sean Leffler <sean@errno.com> | 2017-01-10 18:19:01 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-10 18:19:01 -0800 |
| commit | 6365c4307adb56bb5019f48c50d33b734daffddd (patch) | |
| tree | e461c5382135808f5a84de95885482d06ae949d2 /src/libcore | |
| parent | 0500fbf6ba83b9a6634a5e0580963b44683b44c6 (diff) | |
| download | rust-6365c4307adb56bb5019f48c50d33b734daffddd.tar.gz rust-6365c4307adb56bb5019f48c50d33b734daffddd.zip | |
Add PartialOrd, Ord derivations to TypeId
I want to be able to sort a `Vec` of types which contain `TypeId`s, so an `Ord` derivation would be very useful to me. `Hash` already exists, so the missing `PartialOrd` and `Ord` derivations feel like an oversight to me.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/any.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs index eb0636e8576..1dbe443925e 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -338,7 +338,7 @@ impl Any+Send { /// /// A `TypeId` is currently only available for types which ascribe to `'static`, /// but this limitation may be removed in the future. -#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] #[stable(feature = "rust1", since = "1.0.0")] pub struct TypeId { t: u64, |
