Skip to content

Commit 7ff72f1

Browse files
committed
---
yaml --- r: 6519 b: refs/heads/master c: b40c677 h: refs/heads/master i: 6517: 878eec2 6515: 1e9be91 6511: 67d88f5 v: v3
1 parent 4ef79a9 commit 7ff72f1

File tree

21 files changed

+103
-104
lines changed

21 files changed

+103
-104
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 586a685eecd7786679e93cf0040a0558f47877da
2+
refs/heads/master: b40c6773c2f1a5a34990004cbe9b29a7575e2f7e

trunk/src/comp/front/test.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,17 @@ fn mk_tests(cx: test_ctxt) -> @ast::item {
235235
fn mk_test_desc_vec_ty(cx: test_ctxt) -> @ast::ty {
236236
let test_fn_ty: ast::ty = nospan(
237237
ast::ty_path(
238-
nospan({
238+
@nospan({
239239
global: false,
240240
idents: ["std", "test", "default_test_fn"],
241241
types: []
242242
}),
243243
cx.next_node_id()));
244244

245-
let test_desc_ty_path: ast::path =
246-
nospan({global: false,
247-
idents: ["std", "test", "test_desc"],
248-
types: [@test_fn_ty]});
245+
let test_desc_ty_path =
246+
@nospan({global: false,
247+
idents: ["std", "test", "test_desc"],
248+
types: [@test_fn_ty]});
249249

250250
let test_desc_ty: ast::ty =
251251
nospan(ast::ty_path(test_desc_ty_path, cx.next_node_id()));
@@ -284,7 +284,7 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr {
284284
let name_field: ast::field =
285285
nospan({mut: ast::imm, ident: "name", expr: @name_expr});
286286

287-
let fn_path: ast::path = nospan({global: false, idents: path, types: []});
287+
let fn_path = @nospan({global: false, idents: path, types: []});
288288

289289
let fn_expr: ast::expr =
290290
{id: cx.next_node_id(),
@@ -414,17 +414,17 @@ fn mk_main(cx: test_ctxt) -> @ast::item {
414414
fn mk_test_main_call(cx: test_ctxt) -> @ast::expr {
415415

416416
// Get the args passed to main so we can pass the to test_main
417-
let args_path: ast::path =
418-
nospan({global: false, idents: ["args"], types: []});
417+
let args_path =
418+
@nospan({global: false, idents: ["args"], types: []});
419419

420420
let args_path_expr_: ast::expr_ = ast::expr_path(args_path);
421421

422422
let args_path_expr: ast::expr =
423423
{id: cx.next_node_id(), node: args_path_expr_, span: dummy_sp()};
424424

425425
// Call __test::test to generate the vector of test_descs
426-
let test_path: ast::path =
427-
nospan({global: false, idents: ["tests"], types: []});
426+
let test_path =
427+
@nospan({global: false, idents: ["tests"], types: []});
428428

429429
let test_path_expr_: ast::expr_ = ast::expr_path(test_path);
430430

@@ -437,10 +437,10 @@ fn mk_test_main_call(cx: test_ctxt) -> @ast::expr {
437437
{id: cx.next_node_id(), node: test_call_expr_, span: dummy_sp()};
438438

439439
// Call std::test::test_main
440-
let test_main_path: ast::path =
441-
nospan({global: false,
442-
idents: ["std", "test", "test_main"],
443-
types: []});
440+
let test_main_path =
441+
@nospan({global: false,
442+
idents: ["std", "test", "test_main"],
443+
types: []});
444444

445445
let test_main_path_expr_: ast::expr_ = ast::expr_path(test_main_path);
446446

trunk/src/comp/metadata/tydecode.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn parse_ty_constrs(st: @pstate, sd: str_def) -> [@ty::type_constr] {
8383
do {
8484
next(st);
8585
let one: @ty::type_constr =
86-
parse_constr::<path>(st, sd, parse_ty_constr_arg);
86+
parse_constr::<@path>(st, sd, parse_ty_constr_arg);
8787
rslt += [one];
8888
} while peek(st) as char == ';'
8989
}
@@ -92,7 +92,7 @@ fn parse_ty_constrs(st: @pstate, sd: str_def) -> [@ty::type_constr] {
9292
ret rslt;
9393
}
9494

95-
fn parse_path(st: @pstate, sd: str_def) -> ast::path {
95+
fn parse_path(st: @pstate, sd: str_def) -> @ast::path {
9696
let idents: [ast::ident] = [];
9797
fn is_last(c: char) -> bool { ret c == '(' || c == ':'; }
9898
idents += [parse_ident_(st, sd, is_last)];
@@ -101,8 +101,8 @@ fn parse_path(st: @pstate, sd: str_def) -> ast::path {
101101
':' { next(st); next(st); }
102102
c {
103103
if c == '(' {
104-
ret respan(ast_util::dummy_sp(),
105-
{global: false, idents: idents, types: []});
104+
ret @respan(ast_util::dummy_sp(),
105+
{global: false, idents: idents, types: []});
106106
} else { idents += [parse_ident_(st, sd, is_last)]; }
107107
}
108108
}
@@ -138,7 +138,7 @@ fn parse_constr_arg(st: @pstate, _sd: str_def) -> ast::fn_constr_arg {
138138
}
139139

140140
fn parse_ty_constr_arg(st: @pstate, sd: str_def) ->
141-
ast::constr_arg_general_<path> {
141+
ast::constr_arg_general_<@path> {
142142
alt peek(st) as char {
143143
'*' { st.pos += 1u; ret ast::carg_base; }
144144
c { ret ast::carg_ident(parse_path(st, sd)); }
@@ -149,9 +149,9 @@ fn parse_constr<copy T>(st: @pstate, sd: str_def, pser: arg_parser<T>) ->
149149
@ty::constr_general<T> {
150150
let sp = ast_util::dummy_sp(); // FIXME: use a real span
151151
let args: [@sp_constr_arg<T>] = [];
152-
let pth: path = parse_path(st, sd);
152+
let pth = parse_path(st, sd);
153153
let ignore: char = next(st) as char;
154-
assert (ignore as char == '(');
154+
assert (ignore == '(');
155155
let def = parse_def(st, sd);
156156
let an_arg: constr_arg_general_<T>;
157157
do {

trunk/src/comp/middle/alias.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ tag copied { not_allowed; copied; not_copied; }
1616
tag invalid_reason { overwritten; val_taken; }
1717
type invalid = {reason: invalid_reason,
1818
node_id: node_id,
19-
sp: span, path:
20-
ast::path};
19+
sp: span, path: @ast::path};
2120

2221
tag unsafe_ty { contains(ty::t); mut_contains(ty::t); }
2322

@@ -374,7 +373,7 @@ fn check_for(cx: ctx, local: @ast::local, seq: @ast::expr, blk: ast::blk,
374373
visit::visit_block(blk, {bs: new_bs with sc}, v);
375374
}
376375

377-
fn check_var(cx: ctx, ex: @ast::expr, p: ast::path, id: ast::node_id,
376+
fn check_var(cx: ctx, ex: @ast::expr, p: @ast::path, id: ast::node_id,
378377
assign: bool, sc: scope) {
379378
let def = cx.tcx.def_map.get(id);
380379
if !def_is_local(def, false) { ret; }
@@ -445,7 +444,7 @@ fn check_loop(cx: ctx, sc: scope, checker: block()) {
445444
*sc.invalid = new_invalid;
446445
}
447446

448-
fn test_scope(cx: ctx, sc: scope, b: binding, p: ast::path) {
447+
fn test_scope(cx: ctx, sc: scope, b: binding, p: @ast::path) {
449448
let prob = find_invalid(b.node_id, *sc.invalid);
450449
alt b.root_var {
451450
some(dn) {

trunk/src/comp/middle/resolve.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tag scope {
4444
type scopes = list<scope>;
4545

4646
tag import_state {
47-
todo(ast::node_id, ast::ident, [ast::ident], codemap::span, scopes);
47+
todo(ast::node_id, ast::ident, @[ast::ident], codemap::span, scopes);
4848
resolving(span);
4949
resolved(option::t<def>, /* value */
5050
option::t<def>, /* type */
@@ -172,7 +172,7 @@ fn map_crate(e: @env, c: @ast::crate) {
172172
for ident in idents {
173173
e.imports.insert(ident.node.id,
174174
todo(ident.node.id, ident.node.name,
175-
mod_path + [ident.node.name],
175+
@(*mod_path + [ident.node.name]),
176176
ident.span, sc));
177177
}
178178
}
@@ -214,7 +214,7 @@ fn map_crate(e: @env, c: @ast::crate) {
214214
alt vi.node {
215215
//if it really is a glob import, that is
216216
ast::view_item_import_glob(path, _) {
217-
let imp = follow_import(*e, sc, path, vi.span);
217+
let imp = follow_import(*e, sc, *path, vi.span);
218218
if option::is_some(imp) {
219219
let glob = {def: option::get(imp), item: vi};;
220220
alt list::head(sc) {
@@ -243,7 +243,7 @@ fn resolve_imports(e: env) {
243243
e.imports.values {|v|
244244
alt v {
245245
todo(node_id, name, path, span, scopes) {
246-
resolve_import(e, local_def(node_id), name, path, span, scopes);
246+
resolve_import(e, local_def(node_id), name, *path, span, scopes);
247247
}
248248
resolved(_, _, _, _, _) { }
249249
}
@@ -304,7 +304,7 @@ fn resolve_names(e: @env, c: @ast::crate) {
304304
_ { }
305305
}
306306
}
307-
fn walk_constr(e: @env, p: ast::path, sp: span, id: node_id, sc: scopes,
307+
fn walk_constr(e: @env, p: @ast::path, sp: span, id: node_id, sc: scopes,
308308
_v: vt<scopes>) {
309309
maybe_insert(e, id, lookup_path_strict(*e, sc, sp, p.node, ns_value));
310310
}
@@ -966,7 +966,7 @@ fn found_view_item(e: env, vi: @ast::view_item) -> option::t<def> {
966966
fn lookup_import(e: env, defid: def_id, ns: namespace) -> option::t<def> {
967967
alt e.imports.get(defid.node) {
968968
todo(node_id, name, path, span, scopes) {
969-
resolve_import(e, local_def(node_id), name, path, span, scopes);
969+
resolve_import(e, local_def(node_id), name, *path, span, scopes);
970970
ret lookup_import(e, defid, ns);
971971
}
972972
resolving(sp) {

trunk/src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2967,7 +2967,7 @@ fn trans_local_var(cx: @block_ctxt, def: ast::def) -> lval_result {
29672967
}
29682968
}
29692969

2970-
fn trans_path(cx: @block_ctxt, p: ast::path, id: ast::node_id)
2970+
fn trans_path(cx: @block_ctxt, p: @ast::path, id: ast::node_id)
29712971
-> lval_maybe_callee {
29722972
ret trans_var(cx, p.span, bcx_tcx(cx).def_map.get(id), id);
29732973
}

trunk/src/comp/middle/tstate/auxiliary.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ tag constraint {
194194

195195
// FIXME: really only want it to be mutable during collect_locals.
196196
// freeze it after that.
197-
cpred(path, @mutable [pred_args]);
197+
cpred(@path, @mutable [pred_args]);
198198
}
199199

200200
// An ninit variant has a node_id because it refers to a local var.
@@ -204,7 +204,7 @@ tag constraint {
204204
// and give ninit a constraint saying it's local.
205205
tag tsconstr {
206206
ninit(node_id, ident);
207-
npred(path, def_id, [@constr_arg_use]);
207+
npred(@path, def_id, [@constr_arg_use]);
208208
}
209209

210210
type sp_constr = spanned<tsconstr>;
@@ -773,7 +773,7 @@ fn replace(subst: subst, d: pred_args) -> [constr_arg_general_<inst>] {
773773
ret rslt;
774774
}
775775

776-
fn path_to_ident(cx: ty::ctxt, p: path) -> ident {
776+
fn path_to_ident(cx: ty::ctxt, p: @path) -> ident {
777777
alt vec::last(p.node.idents) {
778778
none. { cx.sess.span_fatal(p.span, "Malformed path"); }
779779
some(i) { ret i; }

trunk/src/comp/middle/tstate/pre_post_conditions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ fn join_then_else(fcx: fn_ctxt, antec: @expr, conseq: blk,
191191
}
192192

193193
fn gen_if_local(fcx: fn_ctxt, lhs: @expr, rhs: @expr, larger_id: node_id,
194-
new_var: node_id, pth: path) {
194+
new_var: node_id, pth: @path) {
195195
alt node_id_to_def(fcx.ccx, new_var) {
196196
some(d) {
197197
alt d {

trunk/src/comp/middle/tstate/states.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn forbid_upvar(fcx: fn_ctxt, rhs_id: node_id, sp: span, t: oper_type) {
2727
}
2828
}
2929

30-
fn handle_move_or_copy(fcx: fn_ctxt, post: poststate, rhs_path: path,
30+
fn handle_move_or_copy(fcx: fn_ctxt, post: poststate, rhs_path: @path,
3131
rhs_id: node_id, instlhs: inst, init_op: init_op) {
3232
forbid_upvar(fcx, rhs_id, rhs_path.span, op_to_oper_ty(init_op));
3333

trunk/src/comp/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ tag sty {
274274
// In the middle end, constraints have a def_id attached, referring
275275
// to the definition of the operator in the constraint.
276276
type constr_general<ARG> = spanned<constr_general_<ARG, def_id>>;
277-
type type_constr = constr_general<path>;
277+
type type_constr = constr_general<@path>;
278278
type constr = constr_general<uint>;
279279

280280
// Data structures used in type unification

trunk/src/comp/middle/typeck.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ fn ty_param_kinds_and_ty_for_def(fcx: @fn_ctxt, sp: span, defn: ast::def) ->
130130

131131
// Instantiates the given path, which must refer to an item with the given
132132
// number of type parameters and type.
133-
fn instantiate_path(fcx: @fn_ctxt, pth: ast::path, tpt: ty_param_kinds_and_ty,
134-
sp: span) -> ty_param_substs_opt_and_ty {
133+
fn instantiate_path(fcx: @fn_ctxt, pth: @ast::path,
134+
tpt: ty_param_kinds_and_ty, sp: span)
135+
-> ty_param_substs_opt_and_ty {
135136
let ty_param_count = vec::len(tpt.kinds);
136137
let bind_result =
137138
bind_params_in_type(sp, fcx.ccx.tcx, bind next_ty_var_id(fcx), tpt.ty,
@@ -2586,7 +2587,7 @@ fn check_constraints(fcx: @fn_ctxt, cs: [@ast::constr], args: [ast::arg]) {
25862587
ast::def_arg(local_def(args[i].id),
25872588
args[i].mode));
25882589
{id: arg_occ_node_id,
2589-
node: ast::expr_path(respan(a.span, p)),
2590+
node: ast::expr_path(@respan(a.span, p)),
25902591
span: a.span}
25912592
} else {
25922593
fcx.ccx.tcx.sess.span_bug(a.span,

trunk/src/comp/syntax/ast.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ tag crate_directive_ {
6161
cdir_src_mod(ident, [attribute]);
6262
cdir_dir_mod(ident, [@crate_directive], [attribute]);
6363
cdir_view_item(@view_item);
64-
cdir_syntax(path);
64+
cdir_syntax(@path);
6565
}
6666

6767
type crate_directive = spanned<crate_directive_>;
@@ -87,7 +87,7 @@ tag pat_ {
8787
pat_wild;
8888
pat_bind(ident);
8989
pat_lit(@lit);
90-
pat_tag(path, [@pat]);
90+
pat_tag(@path, [@pat]);
9191
pat_rec([field_pat], bool);
9292
pat_tup([@pat]);
9393
pat_box(@pat);
@@ -208,7 +208,7 @@ tag expr_ {
208208
expr_assign_op(binop, @expr, @expr);
209209
expr_field(@expr, ident);
210210
expr_index(@expr, @expr);
211-
expr_path(path);
211+
expr_path(@path);
212212
expr_fail(option::t<@expr>);
213213
expr_break;
214214
expr_cont;
@@ -241,7 +241,7 @@ tag blk_sort {
241241
type mac = spanned<mac_>;
242242

243243
tag mac_ {
244-
mac_invoc(path, @expr, option::t<str>);
244+
mac_invoc(@path, @expr, option::t<str>);
245245
mac_embed_type(@ty);
246246
mac_embed_block(blk);
247247
mac_ellipsis;
@@ -328,7 +328,7 @@ tag ty_ {
328328
ty_fn(proto, [ty_arg], @ty, ret_style, [@constr]);
329329
ty_obj([ty_method]);
330330
ty_tup([@ty]);
331-
ty_path(path, node_id);
331+
ty_path(@path, node_id);
332332
ty_type;
333333
ty_constr(@ty, [@ty_constr]);
334334
ty_mac(mac);
@@ -352,7 +352,7 @@ tag constr_arg_general_<T> { carg_base; carg_ident(T); carg_lit(@lit); }
352352

353353
type fn_constr_arg = constr_arg_general_<uint>;
354354
type sp_constr_arg<T> = spanned<constr_arg_general_<T>>;
355-
type ty_constr_arg = sp_constr_arg<path>;
355+
type ty_constr_arg = sp_constr_arg<@path>;
356356
type constr_arg = spanned<fn_constr_arg>;
357357

358358
// Constrained types' args are parameterized by paths, since
@@ -361,14 +361,14 @@ type constr_arg = spanned<fn_constr_arg>;
361361
// constrained type, is * (referring to the base record)
362362

363363
type constr_general_<ARG, ID> =
364-
{path: path, args: [@spanned<constr_arg_general_<ARG>>], id: ID};
364+
{path: @path, args: [@spanned<constr_arg_general_<ARG>>], id: ID};
365365

366366
// In the front end, constraints have a node ID attached.
367367
// Typeck turns this to a def_id, using the output of resolve.
368368
type constr_general<ARG> = spanned<constr_general_<ARG, node_id>>;
369369
type constr_ = constr_general_<uint, node_id>;
370370
type constr = spanned<constr_general_<uint, node_id>>;
371-
type ty_constr_ = ast::constr_general_<ast::path, ast::node_id>;
371+
type ty_constr_ = constr_general_<@path, node_id>;
372372
type ty_constr = spanned<ty_constr_>;
373373

374374
/* The parser generates ast::constrs; resolve generates
@@ -447,9 +447,9 @@ type import_ident = spanned<import_ident_>;
447447

448448
tag view_item_ {
449449
view_item_use(ident, [@meta_item], node_id);
450-
view_item_import(ident, simple_path, node_id);
451-
view_item_import_glob(simple_path, node_id);
452-
view_item_import_from(simple_path, [import_ident], node_id);
450+
view_item_import(ident, @simple_path, node_id);
451+
view_item_import_glob(@simple_path, node_id);
452+
view_item_import_from(@simple_path, [import_ident], node_id);
453453
view_item_export([ident], node_id);
454454
}
455455

trunk/src/comp/syntax/ast_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn mk_sp(lo: uint, hi: uint) -> span {
1414
// make this a const, once the compiler supports it
1515
fn dummy_sp() -> span { ret mk_sp(0u, 0u); }
1616

17-
fn path_name(p: path) -> str { path_name_i(p.node.idents) }
17+
fn path_name(p: @path) -> str { path_name_i(p.node.idents) }
1818

1919
fn path_name_i(idents: [ident]) -> str { str::connect(idents, "::") }
2020

trunk/src/comp/syntax/ext/concat_idents.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, arg: @ast::expr,
1717
}
1818

1919
ret @{id: cx.next_id(),
20-
node:
21-
ast::expr_path({node: {global: false, idents: [res], types: []},
22-
span: sp}),
20+
node: ast::expr_path(@{node: {global: false, idents: [res],
21+
types: []},
22+
span: sp}),
2323
span: sp};
2424
}

0 commit comments

Comments
 (0)