]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/typeck/mod.rs
use TotalEq for HashMap
[rust.git] / src / librustc / middle / typeck / mod.rs
index 22881b26f63e638990dfb9f9801536eef0219824..67db5b7f39620f12c220e1b3478d384bb4a70cca 100644 (file)
@@ -68,7 +68,7 @@
 use util::common::time;
 use util::ppaux::Repr;
 use util::ppaux;
-use util::nodemap::{DefIdMap, FnvHashMap, NodeMap};
+use util::nodemap::{DefIdMap, FnvHashMap};
 
 use std::cell::RefCell;
 use std::rc::Rc;
@@ -148,7 +148,7 @@ pub struct MethodCallee {
     substs: ty::substs
 }
 
-#[deriving(Clone, Eq, Hash)]
+#[deriving(Clone, Eq, TotalEq, Hash, Show)]
 pub struct MethodCall {
     expr_id: ast::NodeId,
     autoderef: u32
@@ -216,7 +216,7 @@ fn repr(&self, tcx: &ty::ctxt) -> ~str {
     }
 }
 
-pub type vtable_map = @RefCell<NodeMap<vtable_res>>;
+pub type vtable_map = @RefCell<FnvHashMap<MethodCall, vtable_res>>;
 
 
 // Information about the vtable resolutions for a trait impl.
@@ -461,7 +461,7 @@ pub fn check_crate(tcx: &ty::ctxt,
     let ccx = CrateCtxt {
         trait_map: trait_map,
         method_map: @RefCell::new(FnvHashMap::new()),
-        vtable_map: @RefCell::new(NodeMap::new()),
+        vtable_map: @RefCell::new(FnvHashMap::new()),
         tcx: tcx
     };