Skip to content

Commit 6365c43

Browse files
authored
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.
1 parent 0500fbf commit 6365c43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/any.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl Any+Send {
338338
///
339339
/// A `TypeId` is currently only available for types which ascribe to `'static`,
340340
/// but this limitation may be removed in the future.
341-
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
341+
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
342342
#[stable(feature = "rust1", since = "1.0.0")]
343343
pub struct TypeId {
344344
t: u64,

0 commit comments

Comments
 (0)