From dbd39f868bad019ea36fc4d7557015f94d255f06 Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Mon, 30 Jul 2012 14:43:44 -0700 Subject: [PATCH] rustc: "ifce" -> "trt" in identifiers --- src/rustc/middle/trans/impl.rs | 8 ++++---- src/rustc/middle/typeck/check/method.rs | 6 +++--- src/rustc/middle/typeck/collect.rs | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/rustc/middle/trans/impl.rs b/src/rustc/middle/trans/impl.rs index 10c410b6ac2..b42dce15fd5 100644 --- a/src/rustc/middle/trans/impl.rs +++ b/src/rustc/middle/trans/impl.rs @@ -255,12 +255,12 @@ fn make_impl_vtable(ccx: @crate_ctxt, impl_id: ast::def_id, substs: ~[ty::t], let tcx = ccx.tcx; // XXX: This should support multiple traits. - let ifce_id = expect(ccx.sess, - ty::ty_to_def_id(ty::impl_traits(tcx, impl_id)[0]), - || ~"make_impl_vtable: non-trait-type implemented"); + let trt_id = expect(ccx.sess, + ty::ty_to_def_id(ty::impl_traits(tcx, impl_id)[0]), + || ~"make_impl_vtable: non-trait-type implemented"); let has_tps = (*ty::lookup_item_type(ccx.tcx, impl_id).bounds).len() > 0u; - make_vtable(ccx, vec::map(*ty::trait_methods(tcx, ifce_id), |im| { + make_vtable(ccx, vec::map(*ty::trait_methods(tcx, trt_id), |im| { let fty = ty::subst_tps(tcx, substs, ty::mk_fn(tcx, im.fty)); if (*im.tps).len() > 0u || ty::type_has_self(fty) { C_null(T_ptr(T_nil())) diff --git a/src/rustc/middle/typeck/check/method.rs b/src/rustc/middle/typeck/check/method.rs index a9ecf5e092e..6f1e97bc342 100644 --- a/src/rustc/middle/typeck/check/method.rs +++ b/src/rustc/middle/typeck/check/method.rs @@ -214,8 +214,8 @@ class lookup { } }; - let ifce_methods = ty::trait_methods(tcx, iid); - alt vec::position(*ifce_methods, |m| m.ident == self.m_name) { + let trt_methods = ty::trait_methods(tcx, iid); + alt vec::position(*trt_methods, |m| m.ident == self.m_name) { none { /* check next bound */ trait_bnd_idx += 1u; @@ -233,7 +233,7 @@ class lookup { with bound_substs}; self.add_candidates_from_m( - substs, ifce_methods[pos], + substs, trt_methods[pos], method_param({trait_id:iid, method_num:pos, param_num:n, diff --git a/src/rustc/middle/typeck/collect.rs b/src/rustc/middle/typeck/collect.rs index 021ab4e6009..60c79407e6d 100644 --- a/src/rustc/middle/typeck/collect.rs +++ b/src/rustc/middle/typeck/collect.rs @@ -325,7 +325,7 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) { write_ty_to_tcx(tcx, it.id, tpt.ty); get_enum_variant_types(ccx, tpt.ty, variants, ty_params, rp); } - ast::item_impl(tps, ifce, selfty, ms) { + ast::item_impl(tps, trt, selfty, ms) { let i_bounds = ty_param_bounds(ccx, tps); let selfty = ccx.to_ty(type_rscope(rp), selfty); write_ty_to_tcx(tcx, it.id, selfty); @@ -335,7 +335,7 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) { ty: selfty}); let cms = convert_methods(ccx, ms, rp, i_bounds, selfty); - for ifce.each |t| { + for trt.each |t| { check_methods_against_trait(ccx, tps, rp, selfty, t, cms); } } @@ -396,11 +396,11 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) { let {bounds, substs} = mk_substs(ccx, tps, rp); let selfty = ty::mk_class(tcx, local_def(it.id), substs); let cms = convert_methods(ccx, methods, rp, bounds, selfty); - for traits.each |ifce| { - check_methods_against_trait(ccx, tps, rp, selfty, ifce, cms); - // ifce.impl_id represents (class, iface) pair - write_ty_to_tcx(tcx, ifce.impl_id, tpt.ty); - tcx.tcache.insert(local_def(ifce.impl_id), tpt); + for traits.each |trt| { + check_methods_against_trait(ccx, tps, rp, selfty, trt, cms); + // trt.impl_id represents (class, iface) pair + write_ty_to_tcx(tcx, trt.impl_id, tpt.ty); + tcx.tcache.insert(local_def(trt.impl_id), tpt); } } _ {