Skip to content

Commit ef450b0

Browse files
committed
---
yaml --- r: 22452 b: refs/heads/master c: b9aa9de h: refs/heads/master v: v3
1 parent c1cd28f commit ef450b0

Some content is hidden

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

60 files changed

+603
-388
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: 9b094c0baf4fa758c80fb9db8cc172f03789adbb
2+
refs/heads/master: b9aa9def858cfc66d411972b10ce3d98479acd78
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/libsyntax/ast.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -678,31 +678,24 @@ type item = {ident: ident, attrs: ~[attribute],
678678
id: node_id, node: item_,
679679
vis: visibility, span: span};
680680

681-
#[auto_serialize]
682-
enum region_param {
683-
rp_none,
684-
rp_self
685-
}
686-
687681
#[auto_serialize]
688682
enum item_ {
689683
item_const(@ty, @expr),
690684
item_fn(fn_decl, ~[ty_param], blk),
691685
item_mod(_mod),
692686
item_foreign_mod(foreign_mod),
693-
item_ty(@ty, ~[ty_param], region_param),
694-
item_enum(~[variant], ~[ty_param], region_param),
687+
item_ty(@ty, ~[ty_param]),
688+
item_enum(~[variant], ~[ty_param]),
695689
item_class(~[ty_param], /* ty params for class */
696690
~[@trait_ref], /* traits this class implements */
697691
~[@class_member], /* methods, etc. */
698692
/* (not including ctor or dtor) */
699693
class_ctor,
700694
/* dtor is optional */
701-
option<class_dtor>,
702-
region_param
695+
option<class_dtor>
703696
),
704-
item_trait(~[ty_param], region_param, ~[ty_method]),
705-
item_impl(~[ty_param], region_param, option<@trait_ref> /* trait */,
697+
item_trait(~[ty_param], ~[ty_method]),
698+
item_impl(~[ty_param], option<@trait_ref> /* trait */,
706699
@ty /* self */, ~[@method]),
707700
item_mac(mac),
708701
}

trunk/src/libsyntax/ast_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ fn map_item(i: @item, cx: ctx, v: vt) {
188188
let item_path = @/* FIXME (#2543) */ copy cx.path;
189189
cx.map.insert(i.id, node_item(i, item_path));
190190
alt i.node {
191-
item_impl(_, _, _, _, ms) {
191+
item_impl(_, _, _, ms) {
192192
let impl_did = ast_util::local_def(i.id);
193193
for ms.each |m| {
194194
map_method(impl_did, extend(cx, i.ident), m,
195195
cx);
196196
}
197197
}
198-
item_enum(vs, _, _) {
198+
item_enum(vs, _) {
199199
for vs.each |v| {
200200
cx.map.insert(v.node.id, node_variant(
201201
/* FIXME (#2543) */ copy v, i,
@@ -214,7 +214,7 @@ fn map_item(i: @item, cx: ctx, v: vt) {
214214
extend(cx, i.ident)));
215215
}
216216
}
217-
item_class(tps, traits, items, ctor, dtor, _) {
217+
item_class(tps, traits, items, ctor, dtor) {
218218
let (_, ms) = ast_util::split_class_items(items);
219219
// Map trait refs to their parent classes. This is
220220
// so we can find the self_ty

trunk/src/libsyntax/ast_util.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fn is_exported(i: ident, m: _mod) -> bool {
155155
for m.items.each |it| {
156156
if it.ident == i { local = true; }
157157
alt it.node {
158-
item_enum(variants, _, _) {
158+
item_enum(variants, _) {
159159
for variants.each |v| {
160160
if v.node.name == i {
161161
local = true;
@@ -428,7 +428,7 @@ fn id_visitor(vfn: fn@(node_id)) -> visit::vt<()> {
428428
visit_item: fn@(i: @item) {
429429
vfn(i.id);
430430
alt i.node {
431-
item_enum(vs, _, _) { for vs.each |v| { vfn(v.node.id); } }
431+
item_enum(vs, _) { for vs.each |v| { vfn(v.node.id); } }
432432
_ {}
433433
}
434434
},
@@ -519,6 +519,9 @@ fn id_visitor(vfn: fn@(node_id)) -> visit::vt<()> {
519519
}
520520
},
521521

522+
visit_ty_method: fn@(_ty_m: ty_method) {
523+
},
524+
522525
visit_class_item: fn@(c: @class_member) {
523526
alt c.node {
524527
instance_var(_, _, _, id,_) {

trunk/src/libsyntax/ext/auto_serialize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ fn expand(cx: ext_ctxt,
102102

103103
do vec::flat_map(in_items) |in_item| {
104104
alt in_item.node {
105-
ast::item_ty(ty, tps, _) {
105+
ast::item_ty(ty, tps) {
106106
vec::append(~[filter_attrs(in_item)],
107107
ty_fns(cx, in_item.ident, ty, tps))
108108
}
109109

110-
ast::item_enum(variants, tps, _) {
110+
ast::item_enum(variants, tps) {
111111
vec::append(~[filter_attrs(in_item)],
112112
enum_fns(cx, in_item.ident,
113113
in_item.span, variants, tps))

trunk/src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ impl ast_builder for ext_ctxt {
128128
+ty_params: ~[ast::ty_param]) -> @ast::item {
129129
self.item(name,
130130
ast::item_enum(variants,
131-
ty_params,
132-
ast::rp_none))
131+
ty_params))
133132
}
134133

135134
fn item_enum(name: ident,
@@ -167,12 +166,10 @@ impl ast_builder for ext_ctxt {
167166
fn item_ty_poly(name: ident,
168167
ty: @ast::ty,
169168
+params: ~[ast::ty_param]) -> @ast::item {
170-
self.item(name,
171-
ast::item_ty(ty, params, ast::rp_none))
169+
self.item(name, ast::item_ty(ty, params))
172170
}
173171

174-
fn item_ty(name: ident,
175-
ty: @ast::ty) -> @ast::item {
172+
fn item_ty(name: ident, ty: @ast::ty) -> @ast::item {
176173
self.item_ty_poly(name, ty, ~[])
177174
}
178175

trunk/src/libsyntax/fold.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,13 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
244244
}
245245
item_mod(m) { item_mod(fld.fold_mod(m)) }
246246
item_foreign_mod(nm) { item_foreign_mod(fld.fold_foreign_mod(nm)) }
247-
item_ty(t, typms, rp) { item_ty(fld.fold_ty(t),
248-
fold_ty_params(typms, fld),
249-
rp) }
250-
item_enum(variants, typms, r) {
247+
item_ty(t, typms) { item_ty(fld.fold_ty(t),
248+
fold_ty_params(typms, fld)) }
249+
item_enum(variants, typms) {
251250
item_enum(vec::map(variants, |x| fld.fold_variant(x)),
252-
fold_ty_params(typms, fld),
253-
r)
251+
fold_ty_params(typms, fld))
254252
}
255-
item_class(typms, traits, items, ctor, m_dtor, rp) {
253+
item_class(typms, traits, items, ctor, m_dtor) {
256254
let ctor_body = fld.fold_block(ctor.node.body);
257255
let ctor_decl = fold_fn_decl(ctor.node.dec, fld);
258256
let ctor_id = fld.new_id(ctor.node.id);
@@ -269,18 +267,16 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
269267
{node: {body: ctor_body,
270268
dec: ctor_decl,
271269
id: ctor_id with ctor.node}
272-
with ctor}, dtor, rp)
270+
with ctor}, dtor)
273271
}
274-
item_impl(tps, rp, ifce, ty, methods) {
272+
item_impl(tps, ifce, ty, methods) {
275273
item_impl(fold_ty_params(tps, fld),
276-
rp,
277274
ifce.map(|p| fold_trait_ref(p, fld)),
278275
fld.fold_ty(ty),
279276
vec::map(methods, |x| fld.fold_method(x)))
280277
}
281-
item_trait(tps, rp, methods) {
278+
item_trait(tps, methods) {
282279
item_trait(fold_ty_params(tps, fld),
283-
rp,
284280
/* FIXME (#2543) */ copy methods)
285281
}
286282
item_mac(m) {

trunk/src/libsyntax/parse/parser.rs

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ import ast::{_mod, add, alt_check, alt_exhaustive, arg, arm, attribute,
4141
pat_box, pat_enum, pat_ident, pat_lit, pat_range, pat_rec,
4242
pat_tup, pat_uniq, pat_wild, path, private, proto, proto_any,
4343
proto_bare, proto_block, proto_box, proto_uniq, public, pure_fn,
44-
purity, re_anon, re_named, region, region_param, rem, ret_style,
45-
return_val, rp_none, rp_self, shl, shr, stmt, stmt_decl,
44+
purity, re_anon, re_named, region, rem, ret_style,
45+
return_val, shl, shr, stmt, stmt_decl,
4646
stmt_expr, stmt_semi, subtract, token_tree, trait_ref, tt_delim,
4747
tt_dotdotdot, tt_flat, tt_interpolate, ty, ty_, ty_bot, ty_box,
4848
ty_constr, ty_constr_, ty_constr_arg, ty_field, ty_fn, ty_infer,
@@ -2133,10 +2133,10 @@ class parser {
21332133

21342134
fn parse_item_trait() -> item_info {
21352135
let ident = self.parse_ident();
2136-
let rp = self.parse_region_param();
2136+
self.parse_region_param();
21372137
let tps = self.parse_ty_params();
21382138
let meths = self.parse_ty_methods();
2139-
(ident, item_trait(tps, rp, meths), none)
2139+
(ident, item_trait(tps, meths), none)
21402140
}
21412141

21422142
// Parses three variants (with the region/type params always optional):
@@ -2147,18 +2147,19 @@ class parser {
21472147
fn wrap_path(p: parser, pt: @path) -> @ty {
21482148
@{id: p.get_id(), node: ty_path(pt, p.get_id()), span: pt.span}
21492149
}
2150-
let mut (ident, rp, tps) = {
2150+
let mut (ident, tps) = {
21512151
if self.token == token::LT {
2152-
(none, rp_none, self.parse_ty_params())
2152+
(none, self.parse_ty_params())
21532153
} else if self.token == token::BINOP(token::SLASH) {
2154-
(none, self.parse_region_param(), self.parse_ty_params())
2154+
self.parse_region_param();
2155+
(none, self.parse_ty_params())
21552156
}
21562157
else if self.is_keyword("of") {
2157-
(none, rp_none, ~[])
2158+
(none, ~[])
21582159
} else {
21592160
let id = self.parse_ident();
2160-
let rp = self.parse_region_param();
2161-
(some(id), rp, self.parse_ty_params())
2161+
self.parse_region_param();
2162+
(some(id), self.parse_ty_params())
21622163
}
21632164
};
21642165
let ifce = if self.eat_keyword("of") {
@@ -2179,25 +2180,18 @@ class parser {
21792180
while !self.eat(token::RBRACE) {
21802181
vec::push(meths, self.parse_method(public));
21812182
}
2182-
(ident, item_impl(tps, rp, ifce, ty, meths), none)
2183+
(ident, item_impl(tps, ifce, ty, meths), none)
21832184
}
21842185

21852186
// Instantiates ident <i> with references to <typarams> as arguments.
21862187
// Used to create a path that refers to a class which will be defined as
21872188
// the return type of the ctor function.
21882189
fn ident_to_path_tys(i: ident,
2189-
rp: region_param,
21902190
typarams: ~[ty_param]) -> @path {
21912191
let s = self.last_span;
21922192

2193-
// Hack. But then, this whole function is in service of a hack.
2194-
let a_r = alt rp {
2195-
rp_none { none }
2196-
rp_self { some(self.region_from_name(some(@"self"))) }
2197-
};
2198-
21992193
@{span: s, global: false, idents: ~[i],
2200-
rp: a_r,
2194+
rp: none,
22012195
types: vec::map(typarams, |tp| {
22022196
@{id: self.get_id(),
22032197
node: ty_path(ident_to_path(s, tp.ident), self.get_id()),
@@ -2218,9 +2212,9 @@ class parser {
22182212

22192213
fn parse_item_class() -> item_info {
22202214
let class_name = self.parse_value_ident();
2221-
let rp = self.parse_region_param();
2215+
self.parse_region_param();
22222216
let ty_params = self.parse_ty_params();
2223-
let class_path = self.ident_to_path_tys(class_name, rp, ty_params);
2217+
let class_path = self.ident_to_path_tys(class_name, ty_params);
22242218
let traits : ~[@trait_ref] = if self.eat(token::COLON)
22252219
{ self.parse_trait_ref_list() }
22262220
else { ~[] };
@@ -2255,7 +2249,7 @@ class parser {
22552249
self_id: self.get_id(),
22562250
dec: ct_d,
22572251
body: ct_b},
2258-
span: ct_s}, actual_dtor, rp),
2252+
span: ct_s}, actual_dtor),
22592253
none)
22602254
}
22612255
/*
@@ -2447,26 +2441,23 @@ class parser {
24472441

24482442
fn parse_item_type() -> item_info {
24492443
let t = self.parse_type_decl();
2450-
let rp = self.parse_region_param();
2444+
self.parse_region_param();
24512445
let tps = self.parse_ty_params();
24522446
self.expect(token::EQ);
24532447
let ty = self.parse_ty(false);
24542448
self.expect(token::SEMI);
2455-
(t.ident, item_ty(ty, tps, rp), none)
2449+
(t.ident, item_ty(ty, tps), none)
24562450
}
24572451

2458-
fn parse_region_param() -> region_param {
2452+
fn parse_region_param() {
24592453
if self.eat(token::BINOP(token::SLASH)) {
24602454
self.expect(token::BINOP(token::AND));
2461-
rp_self
2462-
} else {
2463-
rp_none
24642455
}
24652456
}
24662457

24672458
fn parse_item_enum(default_vis: visibility) -> item_info {
24682459
let id = self.parse_ident();
2469-
let rp = self.parse_region_param();
2460+
self.parse_region_param();
24702461
let ty_params = self.parse_ty_params();
24712462
let mut variants: ~[variant] = ~[];
24722463
// Newtype syntax
@@ -2483,7 +2474,7 @@ class parser {
24832474
id: self.get_id(),
24842475
disr_expr: none,
24852476
vis: public});
2486-
ret (id, item_enum(~[variant], ty_params, rp), none);
2477+
ret (id, item_enum(~[variant], ty_params), none);
24872478
}
24882479
self.expect(token::LBRACE);
24892480

@@ -2521,7 +2512,7 @@ class parser {
25212512
self.fatal("discriminator values can only be used with a c-like \
25222513
enum");
25232514
}
2524-
(id, item_enum(variants, ty_params, rp), none)
2515+
(id, item_enum(variants, ty_params), none)
25252516
}
25262517

25272518
fn parse_fn_ty_proto() -> proto {

0 commit comments

Comments
 (0)