提交 794ee033 编写于 作者: B bors

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?
......@@ -451,7 +451,7 @@ fn visit_leave_fn(&mut self, purity: uint, proto: uint,
/// `TypeId` represents a globally unique identifier for a type
#[lang="type_id"] // This needs to be kept in lockstep with the code in trans/intrinsic.rs and
// middle/lang_items.rs
#[deriving(Eq, Hash, Show)]
#[deriving(Eq, Hash, Show, TotalEq)]
#[cfg(not(test))]
pub struct TypeId {
priv t: u64,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册