Skip to content

Commit 794ee03

Browse files
committed
auto merge of #13154 : tomassedovic/rust/patch-1, r=alexcrichton
HashMap and HashSet require keys to implement TotalEq. This makes it possible to use TypeId as a HashMap key again. Question for reviewers: assuming we want to support `HashMap<TypeId, whatever>`, would it make sense to add a relevant test? If so, should it go to libcollections or libstd?
2 parents b6ea796 + 4d6c47b commit 794ee03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/libstd/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ extern "rust-intrinsic" {
451451
/// `TypeId` represents a globally unique identifier for a type
452452
#[lang="type_id"] // This needs to be kept in lockstep with the code in trans/intrinsic.rs and
453453
// middle/lang_items.rs
454-
#[deriving(Eq, Hash, Show)]
454+
#[deriving(Eq, Hash, Show, TotalEq)]
455455
#[cfg(not(test))]
456456
pub struct TypeId {
457457
priv t: u64,

0 commit comments

Comments
 (0)