Change remaining "iface" occurrences to "trait"; deprecate "iface"
This commit is contained in:
parent
c2f49c46ae
commit
439afaa329
111 changed files with 194 additions and 188 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ fn root_map() -> root_map {
|
|||
// ___________________________________________________________________________
|
||||
// Misc
|
||||
|
||||
iface ast_node {
|
||||
trait ast_node {
|
||||
fn id() -> ast::node_id;
|
||||
fn span() -> span;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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]),
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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(@{
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
~[]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue