From 6365c4307adb56bb5019f48c50d33b734daffddd Mon Sep 17 00:00:00 2001 From: Sean Leffler Date: Tue, 10 Jan 2017 18:19:01 -0800 Subject: [PATCH] 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. --- src/libcore/any.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/any.rs b/src/libcore/any.rs index eb0636e8576b..1dbe443925e4 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,