diff options
| author | Lindsey Kuper <lindsey@rockstargirl.org> | 2012-07-31 10:27:51 -0700 |
|---|---|---|
| committer | Lindsey Kuper <lindsey@rockstargirl.org> | 2012-07-31 11:52:16 -0700 |
| commit | 439afaa329751b3dfd6735862cd2645705598909 (patch) | |
| tree | 4a3c51b47d6ee3c2e057677efdcf29c60e0d9d95 /src/rustc | |
| parent | c2f49c46ae0b07aae8ae558d5a5e71ed85aeff23 (diff) | |
| download | rust-439afaa329751b3dfd6735862cd2645705598909.tar.gz rust-439afaa329751b3dfd6735862cd2645705598909.zip | |
Change remaining "iface" occurrences to "trait"; deprecate "iface"
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/front/intrinsic.rs | 2 | ||||
| -rw-r--r-- | src/rustc/metadata/filesearch.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/astencode.rs | 4 | ||||
| -rw-r--r-- | src/rustc/middle/borrowck.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/resolve3.rs | 28 | ||||
| -rw-r--r-- | src/rustc/middle/ty.rs | 8 | ||||
| -rw-r--r-- | src/rustc/middle/typeck.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/astconv.rs | 4 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/check/method.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/check/vtable.rs | 4 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/collect.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/infer.rs | 16 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/rscope.rs | 2 |
13 files changed, 39 insertions, 39 deletions
diff --git a/src/rustc/front/intrinsic.rs b/src/rustc/front/intrinsic.rs index b980aff822c..1fc320a8311 100644 --- a/src/rustc/front/intrinsic.rs +++ b/src/rustc/front/intrinsic.rs @@ -19,7 +19,7 @@ mod intrinsic { // Remaining fields not listed }; - iface ty_visitor { + trait ty_visitor { fn visit_bot() -> bool; fn visit_nil() -> bool; fn visit_bool() -> bool; diff --git a/src/rustc/metadata/filesearch.rs b/src/rustc/metadata/filesearch.rs index 9e68ce12a3c..6bd002c356e 100644 --- a/src/rustc/metadata/filesearch.rs +++ b/src/rustc/metadata/filesearch.rs @@ -23,7 +23,7 @@ fn pick_file(file: path, path: path) -> option<path> { else { option::none } } -iface filesearch { +trait filesearch { fn sysroot() -> path; fn lib_search_paths() -> ~[path]; fn get_target_lib_path() -> path; diff --git a/src/rustc/middle/astencode.rs b/src/rustc/middle/astencode.rs index bbbf8947792..5ec3c3882ac 100644 --- a/src/rustc/middle/astencode.rs +++ b/src/rustc/middle/astencode.rs @@ -77,7 +77,7 @@ enum extended_decode_ctxt { extended_decode_ctxt_(@extended_decode_ctxt_) } -iface tr { +trait tr { fn tr(xcx: extended_decode_ctxt) -> self; } @@ -910,7 +910,7 @@ fn decode_item_ast(par_doc: ebml::doc) -> @ast::item { } #[cfg(test)] -iface fake_ext_ctxt { +trait fake_ext_ctxt { fn cfg() -> ast::crate_cfg; fn parse_sess() -> parse::parse_sess; } diff --git a/src/rustc/middle/borrowck.rs b/src/rustc/middle/borrowck.rs index 2c326aa68ef..c94326d668a 100644 --- a/src/rustc/middle/borrowck.rs +++ b/src/rustc/middle/borrowck.rs @@ -429,7 +429,7 @@ fn root_map() -> root_map { // ___________________________________________________________________________ // Misc -iface ast_node { +trait ast_node { fn id() -> ast::node_id; fn span() -> span; } diff --git a/src/rustc/middle/resolve3.rs b/src/rustc/middle/resolve3.rs index 1965d5289be..13019f19a8a 100644 --- a/src/rustc/middle/resolve3.rs +++ b/src/rustc/middle/resolve3.rs @@ -3059,7 +3059,7 @@ class Resolver { self_type_rib.bindings.insert(self.self_atom, dl_def(def_self(item.id))); - // Create a new rib for the interface-wide type parameters. + // Create a new rib for the trait-wide type parameters. do self.with_type_parameter_rib (HasTypeParameters(&type_parameters, item.id, 0u, NormalRibKind)) { @@ -3106,12 +3106,12 @@ class Resolver { (*self.type_ribs).pop(); } - item_class(ty_params, interfaces, class_members, + item_class(ty_params, traits, class_members, optional_constructor, optional_destructor) { self.resolve_class(item.id, @copy ty_params, - interfaces, + traits, class_members, optional_constructor, optional_destructor, @@ -3330,8 +3330,8 @@ class Resolver { bound_copy | bound_send | bound_const | bound_owned { // Nothing to do. } - bound_trait(interface_type) { - self.resolve_type(interface_type, visitor); + bound_trait(trait_type) { + self.resolve_type(trait_type, visitor); } } } @@ -3340,7 +3340,7 @@ class Resolver { fn resolve_class(id: node_id, type_parameters: @~[ty_param], - interfaces: ~[@trait_ref], + traits: ~[@trait_ref], class_members: ~[@class_member], optional_constructor: option<class_ctor>, optional_destructor: option<class_dtor>, @@ -3359,22 +3359,22 @@ class Resolver { // Resolve the type parameters. self.resolve_type_parameters(*type_parameters, visitor); - // Resolve implemented interfaces. - for interfaces.each |interface| { - alt self.resolve_path(interface.path, TypeNS, true, visitor) { + // Resolve implemented traits. + for traits.each |trt| { + alt self.resolve_path(trt.path, TypeNS, true, visitor) { none { - self.session.span_err(interface.path.span, + self.session.span_err(trt.path.span, ~"attempt to implement a \ nonexistent trait"); } some(def) { - // Write a mapping from the interface ID to the - // definition of the interface into the definition + // Write a mapping from the trait ID to the + // definition of the trait into the definition // map. debug!{"(resolving class) found trait def: %?", def}; - self.record_def(interface.ref_id, def); + self.record_def(trt.ref_id, def); // XXX: This is wrong but is needed for tests to // pass. @@ -3475,7 +3475,7 @@ class Resolver { // Resolve the type parameters. self.resolve_type_parameters(type_parameters, visitor); - // Resolve the interface reference, if necessary. + // Resolve the trait reference, if necessary. let original_trait_refs = self.current_trait_refs; if trait_references.len() >= 1 { let mut new_trait_refs = @dvec(); diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index bae5b34f5a1..f2903232400 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -392,8 +392,8 @@ type opt_region = option<region>; /// appear within a region-parameterized type is `self`. /// /// `self_ty` is the type to which `self` should be remapped, if any. The -/// `self` type is rather funny in that it can only appear on interfaces and -/// is always substituted away to the implementing type for an interface. +/// `self` type is rather funny in that it can only appear on traits and +/// is always substituted away to the implementing type for a trait. type substs = { self_r: opt_region, self_ty: option<ty::t>, @@ -477,7 +477,7 @@ enum tv_vid = uint; enum tvi_vid = uint; enum region_vid = uint; -iface vid { +trait vid { fn to_uint() -> uint; fn to_str() -> ~str; } @@ -2633,7 +2633,7 @@ fn trait_methods(cx: ctxt, id: ast::def_id) -> @~[method] { some(ms) { ret ms; } _ {} } - // Local interfaces are supposed to have been added explicitly. + // Local traits are supposed to have been added explicitly. assert id.crate != ast::local_crate; let result = csearch::get_trait_methods(cx, id); cx.trait_method_cache.insert(id, result); diff --git a/src/rustc/middle/typeck.rs b/src/rustc/middle/typeck.rs index 2338aa6368c..bf7069f87e2 100644 --- a/src/rustc/middle/typeck.rs +++ b/src/rustc/middle/typeck.rs @@ -142,7 +142,7 @@ enum vtable_origin { */ vtable_param(uint, uint), /* - Dynamic vtable, comes from something known to have an interface + Dynamic vtable, comes from something known to have a trait type. def_id refers to the trait item, tys are the substs */ vtable_trait(ast::def_id, ~[ty::t]), diff --git a/src/rustc/middle/typeck/astconv.rs b/src/rustc/middle/typeck/astconv.rs index 341d9460c4b..1dd8cde5084 100644 --- a/src/rustc/middle/typeck/astconv.rs +++ b/src/rustc/middle/typeck/astconv.rs @@ -13,7 +13,7 @@ * used as the `ast_conv`, `get_item_ty()` just looks up the item type in * `tcx.tcache`. * - * The `region_scope` interface controls how region references are + * The `region_scope` trait controls how region references are * handled. It has two methods which are used to resolve anonymous * region references (e.g., `&T`) and named region references (e.g., * `&a.T`). There are numerous region scopes that can be used, but most @@ -46,7 +46,7 @@ import check::fn_ctxt; import rscope::{anon_rscope, binding_rscope, empty_rscope, in_anon_rscope}; import rscope::{in_binding_rscope, region_scope, type_rscope}; -iface ast_conv { +trait ast_conv { fn tcx() -> ty::ctxt; fn ccx() -> @crate_ctxt; fn get_item_ty(id: ast::def_id) -> ty::ty_param_bounds_and_ty; diff --git a/src/rustc/middle/typeck/check/method.rs b/src/rustc/middle/typeck/check/method.rs index 277891c4eff..ac18b8ccad6 100644 --- a/src/rustc/middle/typeck/check/method.rs +++ b/src/rustc/middle/typeck/check/method.rs @@ -85,7 +85,7 @@ class lookup { } loop { - // First, see whether this is an interface-bounded parameter. + // First, see whether this is a bounded parameter. alt ty::get(self.self_ty).struct { ty::ty_param(p) { self.add_candidates_from_param(p.idx, p.def_id); diff --git a/src/rustc/middle/typeck/check/vtable.rs b/src/rustc/middle/typeck/check/vtable.rs index 70fddb190fb..6baa89e0638 100644 --- a/src/rustc/middle/typeck/check/vtable.rs +++ b/src/rustc/middle/typeck/check/vtable.rs @@ -189,7 +189,7 @@ fn lookup_vtable(fcx: @fn_ctxt, sp: span, ty: ty::t, trait_ty: ty::t, } tcx.sess.span_fatal( - sp, ~"failed to find an implementation of interface " + + sp, ~"failed to find an implementation of trait " + ty_to_str(tcx, trait_ty) + ~" for " + ty_to_str(tcx, ty)); } @@ -291,7 +291,7 @@ fn resolve_expr(ex: @ast::expr, &&fcx: @fn_ctxt, v: visit::vt<@fn_ctxt>) { visit::visit_expr(ex, fcx, v); } -// Detect points where an interface-bounded type parameter is +// Detect points where a trait-bounded type parameter is // instantiated, resolve the impls for the parameters. fn resolve_in_block(fcx: @fn_ctxt, bl: ast::blk) { visit::visit_block(bl, fcx, visit::mk_vt(@{ diff --git a/src/rustc/middle/typeck/collect.rs b/src/rustc/middle/typeck/collect.rs index 83bc02a3755..22063051dce 100644 --- a/src/rustc/middle/typeck/collect.rs +++ b/src/rustc/middle/typeck/collect.rs @@ -587,7 +587,7 @@ fn ty_param_bounds(ccx: @crate_ctxt, _ { ccx.tcx.sess.span_err( t.span, ~"type parameter bounds must be \ - interface types"); + trait types"); ~[] } } diff --git a/src/rustc/middle/typeck/infer.rs b/src/rustc/middle/typeck/infer.rs index e3075ff0058..68420c32de4 100644 --- a/src/rustc/middle/typeck/infer.rs +++ b/src/rustc/middle/typeck/infer.rs @@ -476,7 +476,7 @@ impl methods<T:copy> of cres_helpers<T> for cres<T> { } } -iface to_str { +trait to_str { fn to_str(cx: infer_ctxt) -> ~str; } @@ -533,7 +533,7 @@ impl<V:copy vid, T:copy to_str> of to_str for var_value<V,T> { } } -iface st { +trait st { fn sub(infcx: infer_ctxt, b: self) -> ures; fn lub(infcx: infer_ctxt, b: self) -> cres<self>; fn glb(infcx: infer_ctxt, b: self) -> cres<self>; @@ -1506,7 +1506,7 @@ impl assignment for infer_ctxt { // Type combining // // There are three type combiners: sub, lub, and glb. Each implements -// the interface `combine` and contains methods for combining two +// the trait `combine` and contains methods for combining two // instances of various things and yielding a new instance. These // combiner methods always yield a `result<T>`---failure is propagated // upward using `chain()` methods. @@ -1520,9 +1520,9 @@ impl assignment for infer_ctxt { // to the `super` routine or to do other things. // // In reality, the sub operation is rather different from lub/glb, but -// they are combined into one interface to avoid duplication (they -// used to be separate but there were many bugs because there were two -// copies of most routines). +// they are combined into one trait to avoid duplication (they used to +// be separate but there were many bugs because there were two copies +// of most routines). // // The differences are: // @@ -1548,7 +1548,7 @@ impl assignment for infer_ctxt { type cres<T> = result<T,ty::type_err>; -iface combine { +trait combine { fn infcx() -> infer_ctxt; fn tag() -> ~str; @@ -2457,7 +2457,7 @@ impl of combine for glb { // This is common code used by both LUB and GLB to compute the LUB/GLB // for pairs of variables or for variables and values. -iface lattice_ops { +trait lattice_ops { fn bnd<T:copy>(b: bounds<T>) -> option<T>; fn with_bnd<T:copy>(b: bounds<T>, t: T) -> bounds<T>; fn ty_bot(t: ty::t) -> cres<ty::t>; diff --git a/src/rustc/middle/typeck/rscope.rs b/src/rustc/middle/typeck/rscope.rs index 2c2db4a9c3c..d76f62e17a9 100644 --- a/src/rustc/middle/typeck/rscope.rs +++ b/src/rustc/middle/typeck/rscope.rs @@ -1,6 +1,6 @@ import result::result; -iface region_scope { +trait region_scope { fn anon_region() -> result<ty::region, ~str>; fn named_region(id: ast::ident) -> result<ty::region, ~str>; } |
