Skip to content

Commit 1b1bd03

Browse files
committed
---
yaml --- r: 22844 b: refs/heads/master c: f78776e h: refs/heads/master v: v3
1 parent 78c9229 commit 1b1bd03

File tree

14 files changed

+29
-29
lines changed

14 files changed

+29
-29
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: dbd39f868bad019ea36fc4d7557015f94d255f06
2+
refs/heads/master: f78776e9d8b2ed7028612f782b7e571f3d2e7330
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/rustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ fn encode_info_for_mod(ecx: @encode_ctxt, ebml_w: ebml::writer, md: _mod,
421421
}
422422
_ {
423423
// Must be a re-export, then!
424-
// ...or an iface ref
424+
// ...or a trait ref
425425
ebml_w.wr_str(def_to_str(did));
426426
}
427427
};

trunk/src/rustc/middle/kind.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ fn check_owned(tcx: ty::ctxt, ty: ty::t, sp: span) -> bool {
466466
}
467467

468468
/// This is rather subtle. When we are casting a value to a
469-
/// instantiated iface like `a as iface/&r`, regionck already ensures
469+
/// instantiated trait like `a as trait/&r`, regionck already ensures
470470
/// that any borrowed pointers that appear in the type of `a` are
471471
/// bounded by `&r`. However, it is possible that there are *type
472472
/// parameters* in the type of `a`, and those *type parameters* may
@@ -475,14 +475,14 @@ fn check_owned(tcx: ty::ctxt, ty: ty::t, sp: span) -> bool {
475475
///
476476
/// Therefore, we ensure that one of three conditions holds:
477477
///
478-
/// (1) The iface instance cannot escape the current fn. This is
478+
/// (1) The trait instance cannot escape the current fn. This is
479479
/// guaranteed if the region bound `&r` is some scope within the fn
480480
/// itself. This case is safe because whatever borrowed pointers are
481481
/// found within the type parameter, they must enclose the fn body
482482
/// itself.
483483
///
484-
/// (2) The type parameter appears in the type of the iface. For
485-
/// example, if the type parameter is `T` and the iface type is
484+
/// (2) The type parameter appears in the type of the trait. For
485+
/// example, if the type parameter is `T` and the trait type is
486486
/// `deque<T>`, then whatever borrowed ptrs may appear in `T` also
487487
/// appear in `deque<T>`.
488488
///
@@ -493,15 +493,15 @@ fn check_cast_for_escaping_regions(
493493
source: @expr,
494494
target: @expr) {
495495

496-
// Determine what type we are casting to; if it is not an iface, then no
496+
// Determine what type we are casting to; if it is not an trait, then no
497497
// worries.
498498
let target_ty = ty::expr_ty(cx.tcx, target);
499499
let target_substs = alt ty::get(target_ty).struct {
500500
ty::ty_trait(_, substs) => {substs}
501501
_ => { ret; /* not a cast to a trait */ }
502502
};
503503

504-
// Check, based on the region associated with the iface, whether it can
504+
// Check, based on the region associated with the trait, whether it can
505505
// possibly escape the enclosing fn item (note that all type parameters
506506
// must have been declared on the enclosing fn item):
507507
alt target_substs.self_r {
@@ -514,8 +514,8 @@ fn check_cast_for_escaping_regions(
514514
}
515515
}
516516

517-
// Assuming the iface instance can escape, then ensure that each parameter
518-
// either appears in the iface type or is owned:
517+
// Assuming the trait instance can escape, then ensure that each parameter
518+
// either appears in the trait type or is owned:
519519
let target_params = ty::param_tys_in_type(target_ty);
520520
let source_ty = ty::expr_ty(cx.tcx, source);
521521
do ty::walk_ty(source_ty) |ty| {

trunk/src/rustc/middle/resolve3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3365,7 +3365,7 @@ class Resolver {
33653365
none {
33663366
self.session.span_err(interface.path.span,
33673367
~"attempt to implement a \
3368-
nonexistent interface");
3368+
nonexistent trait");
33693369
}
33703370
some(def) {
33713371
// Write a mapping from the interface ID to the

trunk/src/rustc/middle/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
16111611
remove_send(mutable_type_kind(cx, tm) | kind_safe_for_default_mode())
16121612
}
16131613

1614-
// Iface instances are (for now) like shared boxes, basically
1614+
// Trait instances are (for now) like shared boxes, basically
16151615
ty_trait(_, _) { kind_safe_for_default_mode() | kind_owned() }
16161616

16171617
// Region pointers are copyable but NOT owned nor sendable
@@ -1711,7 +1711,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
17111711
param_bounds_to_kind(cx.ty_param_bounds.get(p.def_id.node))
17121712
}
17131713

1714-
// self is a special type parameter that can only appear in ifaces; it
1714+
// self is a special type parameter that can only appear in traits; it
17151715
// is never bounded in any way, hence it has the bottom kind.
17161716
ty_self { kind_noncopyable() }
17171717

trunk/src/rustc/middle/typeck/check/method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class lookup {
258258
self.tcx().sess.span_err(
259259
self.expr.span,
260260
~"can not call a method that contains a \
261-
self type through a boxed iface");
261+
self type through a boxed trait");
262262
}
263263

264264
if (*m.tps).len() > 0u {

trunk/src/rustc/middle/typeck/check/regionck.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ fn visit_expr(e: @ast::expr, &&rcx: @rcx, v: rvt) {
137137
}
138138

139139
ast::expr_cast(source, _) {
140-
// Determine if we are casting `source` to an iface instance.
140+
// Determine if we are casting `source` to an trait instance.
141141
// If so, we have to be sure that the type of the source obeys
142-
// the iface's region bound.
142+
// the trait's region bound.
143143
//
144144
// Note: there is a subtle point here concerning type
145145
// parameters. It is possible that the type of `source`
@@ -155,12 +155,12 @@ fn visit_expr(e: @ast::expr, &&rcx: @rcx, v: rvt) {
155155
result::ok(target_ty) => {
156156
alt ty::get(target_ty).struct {
157157
ty::ty_trait(_, substs) {
158-
let iface_region = alt substs.self_r {
158+
let trait_region = alt substs.self_r {
159159
some(r) => {r}
160160
none => {ty::re_static}
161161
};
162162
let source_ty = rcx.fcx.expr_ty(source);
163-
constrain_regions_in_type(rcx, iface_region,
163+
constrain_regions_in_type(rcx, trait_region,
164164
e.span, source_ty);
165165
}
166166
_ { }

trunk/src/rustc/middle/typeck/check/vtable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ fn lookup_vtable(fcx: @fn_ctxt, sp: span, ty: ty::t, trait_ty: ty::t,
100100
for vec::each(*ty::trait_methods(tcx, did)) |m| {
101101
if ty::type_has_self(ty::mk_fn(tcx, m.fty)) {
102102
tcx.sess.span_err(
103-
sp, ~"a boxed iface with self types may not be \
103+
sp, ~"a boxed trait with self types may not be \
104104
passed as a bounded type");
105105
} else if (*m.tps).len() > 0u {
106106
tcx.sess.span_err(
107-
sp, ~"a boxed iface with generic methods may not \
107+
sp, ~"a boxed trait with generic methods may not \
108108
be passed as a bounded type");
109109

110110
}

trunk/src/rustc/middle/typeck/collect.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ fn compare_impl_method(tcx: ty::ctxt, sp: span,
195195

196196
if vec::len(impl_m.fty.inputs) != vec::len(if_m.fty.inputs) {
197197
tcx.sess.span_err(sp,#fmt["method `%s` has %u parameters \
198-
but the iface has %u",
198+
but the trait has %u",
199199
*if_m.ident,
200200
vec::len(impl_m.fty.inputs),
201201
vec::len(if_m.fty.inputs)]);
@@ -398,7 +398,7 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) {
398398
let cms = convert_methods(ccx, methods, rp, bounds, selfty);
399399
for traits.each |trt| {
400400
check_methods_against_trait(ccx, tps, rp, selfty, trt, cms);
401-
// trt.impl_id represents (class, iface) pair
401+
// trt.impl_id represents (class, trait) pair
402402
write_ty_to_tcx(tcx, trt.impl_id, tpt.ty);
403403
tcx.tcache.insert(local_def(trt.impl_id), tpt);
404404
}
@@ -455,7 +455,7 @@ fn ty_of_ty_method(self: @crate_ctxt,
455455
fn instantiate_trait_ref(ccx: @crate_ctxt, t: @ast::trait_ref, rp: bool)
456456
-> (ast::def_id, ty_param_substs_and_ty) {
457457

458-
let sp = t.path.span, err = ~"can only implement interface types",
458+
let sp = t.path.span, err = ~"can only implement trait types",
459459
sess = ccx.tcx.sess;
460460

461461
let rscope = type_rscope(rp);

trunk/src/test/compile-fail/class-implements-int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class cat : int { //~ ERROR interface
1+
class cat : int { //~ ERROR trait
22
let meows: uint;
33
new(in_x : uint) { self.meows = in_x; }
44
}

trunk/src/test/compile-fail/iface-impl-different-num-params.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ iface foo {
33
}
44
impl of foo for int {
55
fn bar() -> int {
6-
//~^ ERROR method `bar` has 0 parameters but the iface has 1
6+
//~^ ERROR method `bar` has 0 parameters but the trait has 1
77
self
88
}
99
}

trunk/src/test/compile-fail/issue-2330.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ iface channel<T> {
44
fn send(v: T);
55
}
66

7-
// `chan` is not an iface, it's an enum
8-
impl of chan for int { //~ ERROR can only implement interface types
7+
// `chan` is not a trait, it's an enum
8+
impl of chan for int { //~ ERROR can only implement trait types
99
fn send(v: int) { fail }
1010
}
1111

trunk/src/test/compile-fail/selftype-astparam.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ fn do_add<A:add>(x: A, y: A) -> A { x.plus(y) }
1111
fn main() {
1212
let x = 3 as add;
1313
let y = 4 as add;
14-
do_add(x, y); //~ ERROR a boxed iface with self types may not be passed as a bounded type
14+
do_add(x, y); //~ ERROR a boxed trait with self types may not be passed as a bounded type
1515
}

trunk/src/test/compile-fail/selftype-ifacetype.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ iface add {
33
}
44

55
fn do_add(x: add, y: add) -> add {
6-
x.plus(y) //~ ERROR can not call a method that contains a self type through a boxed iface
6+
x.plus(y) //~ ERROR can not call a method that contains a self type through a boxed trait
77
}
88

99
fn main() {}

0 commit comments

Comments
 (0)