Skip to content

Commit 59c5a32

Browse files
committed
---
yaml --- r: 24571 b: refs/heads/try2 c: 33334f3 h: refs/heads/master i: 24569: 1b60b08 24567: 95547c2 v: v3
1 parent 9ee9e36 commit 59c5a32

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+454
-452
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d93f3c5d835f12614f07c2d840799dd02f4780bc
8+
refs/heads/try2: 33334f3c435926422d88dcd5bfafd5e32b141111
99
refs/heads/incoming: 05543fd04dfb3f63b453a331e239ceb1a9a219f9
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/libsyntax/ast.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ enum ty_param_bound {
6262
bound_copy,
6363
bound_send,
6464
bound_const,
65-
bound_iface(@ty),
65+
bound_trait(@ty),
6666
}
6767

6868
#[auto_serialize]
@@ -657,11 +657,11 @@ enum attr_style { attr_outer, attr_inner, }
657657
type attribute_ = {style: attr_style, value: meta_item, is_sugared_doc: bool};
658658

659659
/*
660-
iface_refs appear in both impls and in classes that implement ifaces.
661-
resolve maps each iface_ref's id to its defining iface.
660+
trait_refs appear in both impls and in classes that implement traits.
661+
resolve maps each trait_ref's id to its defining trait.
662662
*/
663663
#[auto_serialize]
664-
type iface_ref = {path: @path, id: node_id};
664+
type trait_ref = {path: @path, id: node_id};
665665

666666
#[auto_serialize]
667667
enum visibility { public, private }
@@ -686,16 +686,16 @@ enum item_ {
686686
item_ty(@ty, ~[ty_param], region_param),
687687
item_enum(~[variant], ~[ty_param], region_param),
688688
item_class(~[ty_param], /* ty params for class */
689-
~[@iface_ref], /* ifaces this class implements */
689+
~[@trait_ref], /* traits this class implements */
690690
~[@class_member], /* methods, etc. */
691691
/* (not including ctor or dtor) */
692692
class_ctor,
693693
/* dtor is optional */
694694
option<class_dtor>,
695695
region_param
696696
),
697-
item_iface(~[ty_param], region_param, ~[ty_method]),
698-
item_impl(~[ty_param], region_param, option<@iface_ref> /* iface */,
697+
item_trait(~[ty_param], region_param, ~[ty_method]),
698+
item_impl(~[ty_param], region_param, option<@trait_ref> /* trait */,
699699
@ty /* self */, ~[@method]),
700700
}
701701

branches/try2/src/libsyntax/ast_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ fn map_item(i: @item, cx: ctx, v: vt) {
214214
extend(cx, i.ident)));
215215
}
216216
}
217-
item_class(tps, ifces, items, ctor, dtor, _) {
217+
item_class(tps, traits, items, ctor, dtor, _) {
218218
let (_, ms) = ast_util::split_class_items(items);
219-
// Map iface refs to their parent classes. This is
219+
// Map trait refs to their parent classes. This is
220220
// so we can find the self_ty
221-
do vec::iter(ifces) |p| { cx.map.insert(p.id,
221+
do vec::iter(traits) |p| { cx.map.insert(p.id,
222222
node_item(i, item_path)); };
223223
let d_id = ast_util::local_def(i.id);
224224
let p = extend(cx, i.ident);

branches/try2/src/libsyntax/ext/auto_serialize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ fn mk_ser_fn(cx: ext_ctxt, span: span, name: ast::ident,
530530
}
531531

532532
let ser_bnds = @~[
533-
ast::bound_iface(cx.ty_path(span,
533+
ast::bound_trait(cx.ty_path(span,
534534
~[@"std", @"serialization",
535535
@"serializer"],
536536
~[]))];
@@ -736,7 +736,7 @@ fn mk_deser_fn(cx: ext_ctxt, span: span,
736736
}
737737

738738
let deser_bnds = @~[
739-
ast::bound_iface(cx.ty_path(
739+
ast::bound_trait(cx.ty_path(
740740
span,
741741
~[@"std", @"serialization", @"deserializer"],
742742
~[]))];

branches/try2/src/libsyntax/fold.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn fold_fn_decl(decl: ast::fn_decl, fld: ast_fold) -> ast::fn_decl {
142142
fn fold_ty_param_bound(tpb: ty_param_bound, fld: ast_fold) -> ty_param_bound {
143143
alt tpb {
144144
bound_copy | bound_send | bound_const { tpb }
145-
bound_iface(ty) { bound_iface(fld.fold_ty(ty)) }
145+
bound_trait(ty) { bound_trait(fld.fold_ty(ty)) }
146146
}
147147
}
148148

@@ -252,7 +252,7 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
252252
fold_ty_params(typms, fld),
253253
r)
254254
}
255-
item_class(typms, ifaces, items, ctor, m_dtor, rp) {
255+
item_class(typms, traits, items, ctor, m_dtor, rp) {
256256
let ctor_body = fld.fold_block(ctor.node.body);
257257
let ctor_decl = fold_fn_decl(ctor.node.dec, fld);
258258
let ctor_id = fld.new_id(ctor.node.id);
@@ -264,7 +264,7 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
264264
with dtor}};
265265
item_class(
266266
/* FIXME (#2543) */ copy typms,
267-
vec::map(ifaces, |p| fold_iface_ref(p, fld)),
267+
vec::map(traits, |p| fold_trait_ref(p, fld)),
268268
vec::map(items, fld.fold_class_item),
269269
{node: {body: ctor_body,
270270
dec: ctor_decl,
@@ -274,19 +274,19 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
274274
item_impl(tps, rp, ifce, ty, methods) {
275275
item_impl(fold_ty_params(tps, fld),
276276
rp,
277-
ifce.map(|p| fold_iface_ref(p, fld)),
277+
ifce.map(|p| fold_trait_ref(p, fld)),
278278
fld.fold_ty(ty),
279279
vec::map(methods, fld.fold_method))
280280
}
281-
item_iface(tps, rp, methods) {
282-
item_iface(fold_ty_params(tps, fld),
281+
item_trait(tps, rp, methods) {
282+
item_trait(fold_ty_params(tps, fld),
283283
rp,
284284
/* FIXME (#2543) */ copy methods)
285285
}
286286
};
287287
}
288288

289-
fn fold_iface_ref(&&p: @iface_ref, fld: ast_fold) -> @iface_ref {
289+
fn fold_trait_ref(&&p: @trait_ref, fld: ast_fold) -> @trait_ref {
290290
@{path: fld.fold_path(p.path), id: fld.new_id(p.id)}
291291
}
292292

branches/try2/src/libsyntax/parse/parser.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,7 @@ class parser {
18921892
else if self.eat_keyword("const") {
18931893
push(bounds, bound_const)
18941894
}
1895-
else { push(bounds, bound_iface(self.parse_ty(false))); }
1895+
else { push(bounds, bound_trait(self.parse_ty(false))); }
18961896
}
18971897
}
18981898
ret {ident: ident, id: self.get_id(), bounds: @bounds};
@@ -2008,12 +2008,12 @@ class parser {
20082008
self_id: self.get_id(), vis: pr}
20092009
}
20102010

2011-
fn parse_item_iface() -> item_info {
2011+
fn parse_item_trait() -> item_info {
20122012
let ident = self.parse_ident();
20132013
let rp = self.parse_region_param();
20142014
let tps = self.parse_ty_params();
20152015
let meths = self.parse_ty_methods();
2016-
(ident, item_iface(tps, rp, meths), none)
2016+
(ident, item_trait(tps, rp, meths), none)
20172017
}
20182018

20192019
// Parses three variants (with the region/type params always optional):
@@ -2082,24 +2082,24 @@ class parser {
20822082
}
20832083
}
20842084

2085-
fn parse_iface_ref() -> @iface_ref {
2085+
fn parse_trait_ref() -> @trait_ref {
20862086
@{path: self.parse_path_with_tps(false),
20872087
id: self.get_id()}
20882088
}
20892089

2090-
fn parse_iface_ref_list() -> ~[@iface_ref] {
2090+
fn parse_trait_ref_list() -> ~[@trait_ref] {
20912091
self.parse_seq_to_before_end(
20922092
token::LBRACE, seq_sep_trailing_disallowed(token::COMMA),
2093-
|p| p.parse_iface_ref())
2093+
|p| p.parse_trait_ref())
20942094
}
20952095

20962096
fn parse_item_class() -> item_info {
20972097
let class_name = self.parse_value_ident();
20982098
let rp = self.parse_region_param();
20992099
let ty_params = self.parse_ty_params();
21002100
let class_path = self.ident_to_path_tys(class_name, rp, ty_params);
2101-
let ifaces : ~[@iface_ref] = if self.eat(token::COLON)
2102-
{ self.parse_iface_ref_list() }
2101+
let traits : ~[@trait_ref] = if self.eat(token::COLON)
2102+
{ self.parse_trait_ref_list() }
21032103
else { ~[] };
21042104
self.expect(token::LBRACE);
21052105
let mut ms: ~[@class_member] = ~[];
@@ -2127,7 +2127,7 @@ class parser {
21272127
alt the_ctor {
21282128
some((ct_d, ct_b, ct_s)) {
21292129
(class_name,
2130-
item_class(ty_params, ifaces, ms, {
2130+
item_class(ty_params, traits, ms, {
21312131
node: {id: ctor_id,
21322132
self_id: self.get_id(),
21332133
dec: ct_d,
@@ -2462,7 +2462,9 @@ class parser {
24622462
} else if self.eat_keyword("enum") {
24632463
self.parse_item_enum(vis)
24642464
} else if self.eat_keyword("iface") {
2465-
self.parse_item_iface()
2465+
self.parse_item_trait()
2466+
} else if self.eat_keyword("trait") {
2467+
self.parse_item_trait()
24662468
} else if self.eat_keyword("impl") {
24672469
self.parse_item_impl()
24682470
} else if self.eat_keyword("class") {

branches/try2/src/libsyntax/print/pprust.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,14 +494,14 @@ fn print_item(s: ps, &&item: @ast::item) {
494494
bclose(s, item.span);
495495
}
496496
}
497-
ast::item_class(tps, ifaces, items, ctor, m_dtor, rp) {
497+
ast::item_class(tps, traits, items, ctor, m_dtor, rp) {
498498
head(s, "class");
499499
word_nbsp(s, *item.ident);
500500
print_region_param(s, rp);
501501
print_type_params(s, tps);
502-
if vec::len(ifaces) != 0u {
502+
if vec::len(traits) != 0u {
503503
word_space(s, ":");
504-
commasep(s, inconsistent, ifaces, |s, p|
504+
commasep(s, inconsistent, traits, |s, p|
505505
print_path(s, p.path, false));
506506
}
507507
bopen(s);
@@ -579,7 +579,7 @@ fn print_item(s: ps, &&item: @ast::item) {
579579
}
580580
bclose(s, item.span);
581581
}
582-
ast::item_iface(tps, rp, methods) {
582+
ast::item_trait(tps, rp, methods) {
583583
head(s, "iface");
584584
word(s.s, *item.ident);
585585
print_region_param(s, rp);
@@ -1350,7 +1350,7 @@ fn print_bounds(s: ps, bounds: @~[ast::ty_param_bound]) {
13501350
ast::bound_copy { word(s.s, "copy"); }
13511351
ast::bound_send { word(s.s, "send"); }
13521352
ast::bound_const { word(s.s, "const"); }
1353-
ast::bound_iface(t) { print_type(s, t); }
1353+
ast::bound_trait(t) { print_type(s, t); }
13541354
}
13551355
}
13561356
}

branches/try2/src/libsyntax/visit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,19 @@ fn visit_item<E>(i: @item, e: E, v: vt<E>) {
143143
visit_method_helper(m, e, v)
144144
}
145145
}
146-
item_class(tps, ifaces, members, ctor, m_dtor, _) {
146+
item_class(tps, traits, members, ctor, m_dtor, _) {
147147
v.visit_ty_params(tps, e, v);
148148
for members.each |m| {
149149
v.visit_class_item(m, e, v);
150150
}
151-
for ifaces.each |p| { visit_path(p.path, e, v); }
151+
for traits.each |p| { visit_path(p.path, e, v); }
152152
visit_class_ctor_helper(ctor, i.ident, tps,
153153
ast_util::local_def(i.id), e, v);
154154
do option::iter(m_dtor) |dtor| {
155155
visit_class_dtor_helper(dtor, tps,
156156
ast_util::local_def(i.id), e, v)};
157157
}
158-
item_iface(tps, _rp, methods) {
158+
item_trait(tps, _rp, methods) {
159159
v.visit_ty_params(tps, e, v);
160160
for methods.each |m| {
161161
for m.decl.inputs.each |a| { v.visit_ty(a.ty, e, v); }
@@ -260,7 +260,7 @@ fn visit_ty_params<E>(tps: ~[ty_param], e: E, v: vt<E>) {
260260
for tps.each |tp| {
261261
for vec::each(*tp.bounds) |bound| {
262262
alt bound {
263-
bound_iface(t) { v.visit_ty(t, e, v); }
263+
bound_trait(t) { v.visit_ty(t, e, v); }
264264
bound_copy | bound_send | bound_const { }
265265
}
266266
}

branches/try2/src/rustc/front/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ mod intrinsic {
106106
fn visit_leave_fn(purity: uint, proto: uint,
107107
n_inputs: uint, retstyle: uint) -> bool;
108108

109-
fn visit_iface() -> bool;
109+
fn visit_trait() -> bool;
110110
fn visit_enter_res() -> bool;
111111
fn visit_leave_res() -> bool;
112112
fn visit_var() -> bool;

branches/try2/src/rustc/metadata/astencode.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ impl of tr for method_origin {
380380
typeck::method_param(did, m, p, b) {
381381
typeck::method_param(did.tr(xcx), m, p, b)
382382
}
383-
typeck::method_iface(did, m) {
384-
typeck::method_iface(did.tr(xcx), m)
383+
typeck::method_trait(did, m) {
384+
typeck::method_trait(did.tr(xcx), m)
385385
}
386386
}
387387
}
@@ -441,8 +441,8 @@ fn encode_vtable_origin(ecx: @e::encode_ctxt,
441441
}
442442
}
443443
}
444-
typeck::vtable_iface(def_id, tys) {
445-
ebml_w.emit_enum_variant("vtable_iface", 1u, 3u) {||
444+
typeck::vtable_trait(def_id, tys) {
445+
ebml_w.emit_enum_variant("vtable_trait", 1u, 3u) {||
446446
ebml_w.emit_enum_variant_arg(0u) {||
447447
ebml_w.emit_def_id(def_id)
448448
}
@@ -490,7 +490,7 @@ impl helpers for ebml::ebml_deserializer {
490490
)
491491
}
492492
2u {
493-
typeck::vtable_iface(
493+
typeck::vtable_trait(
494494
self.read_enum_variant_arg(0u) {||
495495
self.read_def_id(xcx)
496496
},

branches/try2/src/rustc/metadata/common.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ const tag_crate_dep_vers: uint = 0x2cu;
7070

7171
const tag_mod_impl: uint = 0x30u;
7272

73-
const tag_item_iface_method: uint = 0x31u;
74-
const tag_impl_iface: uint = 0x32u;
73+
const tag_item_trait_method: uint = 0x31u;
74+
const tag_impl_trait: uint = 0x32u;
7575

7676
// discriminator value for variants
7777
const tag_disr_val: uint = 0x34u;
@@ -85,13 +85,13 @@ const tag_item_field: uint = 0x44u;
8585
const tag_class_mut: uint = 0x45u;
8686

8787
const tag_region_param: uint = 0x46u;
88-
const tag_mod_impl_iface: uint = 0x47u;
88+
const tag_mod_impl_trait: uint = 0x47u;
8989
/*
90-
iface items contain tag_item_iface_method elements,
90+
trait items contain tag_item_trait_method elements,
9191
impl items contain tag_item_impl_method elements, and classes
92-
have both. That's because some code treats classes like ifaces,
92+
have both. That's because some code treats classes like traits,
9393
and other code treats them like impls. Because classes can contain
94-
both, tag_item_iface_method and tag_item_impl_method have to be two
94+
both, tag_item_trait_method and tag_item_impl_method have to be two
9595
different tags.
9696
*/
9797
const tag_item_impl_method: uint = 0x48u;

0 commit comments

Comments
 (0)