Skip to content

Commit 956129c

Browse files
committed
ident->name
1 parent eabeba3 commit 956129c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/librustc/middle/trans/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub struct CrateContext {
8787
// Cache of external const values
8888
extern_const_values: HashMap<ast::DefId, ValueRef>,
8989

90-
impl_method_cache: HashMap<(ast::DefId, ast::Ident), ast::DefId>,
90+
impl_method_cache: HashMap<(ast::DefId, ast::Name), ast::DefId>,
9191

9292
module_data: HashMap<~str, ValueRef>,
9393
lltypes: HashMap<ty::t, Type>,

src/librustc/middle/trans/meth.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ pub fn trans_static_method_callee(bcx: @mut Block,
268268
typeck::vtable_static(impl_did, ref rcvr_substs, rcvr_origins) => {
269269
assert!(rcvr_substs.iter().all(|t| !ty::type_needs_infer(*t)));
270270

271-
let mth_id = method_with_name(bcx.ccx(), impl_did, mname);
271+
let mth_id = method_with_name(bcx.ccx(), impl_did, mname.name);
272272
let (callee_substs, callee_origins) =
273273
combine_impl_and_methods_tps(
274274
bcx, mth_id, callee_id,
@@ -294,8 +294,7 @@ pub fn trans_static_method_callee(bcx: @mut Block,
294294

295295
pub fn method_with_name(ccx: &mut CrateContext,
296296
impl_id: ast::DefId,
297-
name: ast::Ident) -> ast::DefId {
298-
// NOTE : SHOULD USE NAME (chonged later)
297+
name: ast::Name) -> ast::DefId {
299298
let meth_id_opt = ccx.impl_method_cache.find_copy(&(impl_id, name));
300299
match meth_id_opt {
301300
Some(m) => return m,
@@ -304,7 +303,7 @@ pub fn method_with_name(ccx: &mut CrateContext,
304303

305304
let imp = ccx.tcx.impls.find(&impl_id)
306305
.expect("could not find impl while translating");
307-
let meth = imp.methods.iter().find(|m| m.ident.name == name.name)
306+
let meth = imp.methods.iter().find(|m| m.ident.name == name)
308307
.expect("could not find method while translating");
309308

310309
ccx.impl_method_cache.insert((impl_id, name), meth.def_id);
@@ -324,7 +323,7 @@ pub fn trans_monomorphized_callee(bcx: @mut Block,
324323
typeck::vtable_static(impl_did, ref rcvr_substs, rcvr_origins) => {
325324
let ccx = bcx.ccx();
326325
let mname = ty::trait_method(ccx.tcx, trait_id, n_method).ident;
327-
let mth_id = method_with_name(bcx.ccx(), impl_did, mname);
326+
let mth_id = method_with_name(bcx.ccx(), impl_did, mname.name);
328327

329328
// obtain the `self` value:
330329
let mut temp_cleanups = ~[];
@@ -601,7 +600,7 @@ fn emit_vtable_methods(bcx: @mut Block,
601600
let ident = ty::method(tcx, *method_def_id).ident;
602601
// The substitutions we have are on the impl, so we grab
603602
// the method type from the impl to substitute into.
604-
let m_id = method_with_name(ccx, impl_id, ident);
603+
let m_id = method_with_name(ccx, impl_id, ident.name);
605604
let m = ty::method(tcx, m_id);
606605
debug!("(making impl vtable) emitting method %s at subst %s",
607606
m.repr(tcx),

0 commit comments

Comments
 (0)