about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Clements <clements@racket-lang.org>2013-09-05 13:57:52 -0700
committerJohn Clements <clements@racket-lang.org>2013-09-06 13:35:14 -0700
commit956129cbb2a86b0d95e283b60a076934bd3a1e3a (patch)
tree177139c3f9907f6d9e3ad209ab2e5962e525f2d1
parenteabeba3ef309b09a1acd8adfbca13203a0766d75 (diff)
downloadrust-956129cbb2a86b0d95e283b60a076934bd3a1e3a.tar.gz
rust-956129cbb2a86b0d95e283b60a076934bd3a1e3a.zip
ident->name
-rw-r--r--src/librustc/middle/trans/context.rs2
-rw-r--r--src/librustc/middle/trans/meth.rs11
2 files changed, 6 insertions, 7 deletions
diff --git a/src/librustc/middle/trans/context.rs b/src/librustc/middle/trans/context.rs
index 59159f61f48..6eb2fcf25fd 100644
--- a/src/librustc/middle/trans/context.rs
+++ b/src/librustc/middle/trans/context.rs
@@ -87,7 +87,7 @@ pub struct CrateContext {
      // Cache of external const values
      extern_const_values: HashMap<ast::DefId, ValueRef>,
 
-     impl_method_cache: HashMap<(ast::DefId, ast::Ident), ast::DefId>,
+     impl_method_cache: HashMap<(ast::DefId, ast::Name), ast::DefId>,
 
      module_data: HashMap<~str, ValueRef>,
      lltypes: HashMap<ty::t, Type>,
diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs
index 3dfdb551634..e49265a99a9 100644
--- a/src/librustc/middle/trans/meth.rs
+++ b/src/librustc/middle/trans/meth.rs
@@ -268,7 +268,7 @@ pub fn trans_static_method_callee(bcx: @mut Block,
         typeck::vtable_static(impl_did, ref rcvr_substs, rcvr_origins) => {
             assert!(rcvr_substs.iter().all(|t| !ty::type_needs_infer(*t)));
 
-            let mth_id = method_with_name(bcx.ccx(), impl_did, mname);
+            let mth_id = method_with_name(bcx.ccx(), impl_did, mname.name);
             let (callee_substs, callee_origins) =
                 combine_impl_and_methods_tps(
                     bcx, mth_id, callee_id,
@@ -294,8 +294,7 @@ pub fn trans_static_method_callee(bcx: @mut Block,
 
 pub fn method_with_name(ccx: &mut CrateContext,
                         impl_id: ast::DefId,
-                        name: ast::Ident) -> ast::DefId {
-    // NOTE : SHOULD USE NAME (chonged later)
+                        name: ast::Name) -> ast::DefId {
     let meth_id_opt = ccx.impl_method_cache.find_copy(&(impl_id, name));
     match meth_id_opt {
         Some(m) => return m,
@@ -304,7 +303,7 @@ pub fn method_with_name(ccx: &mut CrateContext,
 
     let imp = ccx.tcx.impls.find(&impl_id)
         .expect("could not find impl while translating");
-    let meth = imp.methods.iter().find(|m| m.ident.name == name.name)
+    let meth = imp.methods.iter().find(|m| m.ident.name == name)
         .expect("could not find method while translating");
 
     ccx.impl_method_cache.insert((impl_id, name), meth.def_id);
@@ -324,7 +323,7 @@ pub fn trans_monomorphized_callee(bcx: @mut Block,
       typeck::vtable_static(impl_did, ref rcvr_substs, rcvr_origins) => {
           let ccx = bcx.ccx();
           let mname = ty::trait_method(ccx.tcx, trait_id, n_method).ident;
-          let mth_id = method_with_name(bcx.ccx(), impl_did, mname);
+          let mth_id = method_with_name(bcx.ccx(), impl_did, mname.name);
 
           // obtain the `self` value:
           let mut temp_cleanups = ~[];
@@ -601,7 +600,7 @@ fn emit_vtable_methods(bcx: @mut Block,
         let ident = ty::method(tcx, *method_def_id).ident;
         // The substitutions we have are on the impl, so we grab
         // the method type from the impl to substitute into.
-        let m_id = method_with_name(ccx, impl_id, ident);
+        let m_id = method_with_name(ccx, impl_id, ident.name);
         let m = ty::method(tcx, m_id);
         debug!("(making impl vtable) emitting method %s at subst %s",
                m.repr(tcx),