diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-07-06 11:26:26 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-07-06 11:26:26 -0700 |
| commit | bbdba21b1f3c7dfc4c0bac3525cc35939ae8ca4c (patch) | |
| tree | d9cb0046b2a608b4b44c54eacce7951326c65df2 /src/comp/syntax/ext | |
| parent | ec890fff23d80da97086e89f29ef7f8d14dbaab8 (diff) | |
| download | rust-bbdba21b1f3c7dfc4c0bac3525cc35939ae8ca4c.tar.gz rust-bbdba21b1f3c7dfc4c0bac3525cc35939ae8ca4c.zip | |
rustc: Revert the conversion to interior vectors due to heap corruption
Diffstat (limited to 'src/comp/syntax/ext')
| -rw-r--r-- | src/comp/syntax/ext/base.rs | 5 | ||||
| -rw-r--r-- | src/comp/syntax/ext/fmt.rs | 11 | ||||
| -rw-r--r-- | src/comp/syntax/ext/simplext.rs | 6 |
3 files changed, 10 insertions, 12 deletions
diff --git a/src/comp/syntax/ext/base.rs b/src/comp/syntax/ext/base.rs index 766dd9f3f28..a0ba306edfa 100644 --- a/src/comp/syntax/ext/base.rs +++ b/src/comp/syntax/ext/base.rs @@ -1,4 +1,3 @@ -import std::ivec; import std::vec; import std::option; import std::map::hashmap; @@ -72,8 +71,8 @@ fn expr_to_str(&ext_ctxt cx, @ast::expr expr, str error) -> str { fn expr_to_ident(&ext_ctxt cx, @ast::expr expr, str error) -> ast::ident { alt(expr.node) { case (ast::expr_path(?p)) { - if (ivec::len(p.node.types) > 0u - || ivec::len(p.node.idents) != 1u) { + if (vec::len(p.node.types) > 0u + || vec::len(p.node.idents) != 1u) { cx.span_fatal(expr.span, error); } else { ret p.node.idents.(0); diff --git a/src/comp/syntax/ext/fmt.rs b/src/comp/syntax/ext/fmt.rs index c7e2787d502..1ea2d694374 100644 --- a/src/comp/syntax/ext/fmt.rs +++ b/src/comp/syntax/ext/fmt.rs @@ -60,9 +60,10 @@ fn pieces_to_expr(&ext_ctxt cx, span sp, vec[piece] pieces, auto binexpr = ast::expr_binary(ast::add, lhs, rhs); ret @rec(id=cx.next_id(), node=binexpr, span=sp); } - fn make_path_expr(&ext_ctxt cx, span sp, &ast::ident[] idents) + fn make_path_expr(&ext_ctxt cx, span sp, vec[ast::ident] idents) -> @ast::expr { - auto path = rec(idents=idents, types=~[]); + let vec[@ast::ty] types = []; + auto path = rec(idents=idents, types=types); auto sp_path = rec(node=path, span=sp); auto pathexpr = ast::expr_path(sp_path); ret @rec(id=cx.next_id(), node=pathexpr, span=sp); @@ -72,7 +73,7 @@ fn pieces_to_expr(&ext_ctxt cx, span sp, vec[piece] pieces, auto vecexpr = ast::expr_vec(exprs, ast::imm, ast::sk_rc); ret @rec(id=cx.next_id(), node=vecexpr, span=sp); } - fn make_call(&ext_ctxt cx, span sp, &ast::ident[] fn_path, + fn make_call(&ext_ctxt cx, span sp, vec[ast::ident] fn_path, vec[@ast::expr] args) -> @ast::expr { auto pathexpr = make_path_expr(cx, sp, fn_path); auto callexpr = ast::expr_call(pathexpr, args); @@ -91,11 +92,11 @@ fn pieces_to_expr(&ext_ctxt cx, span sp, vec[piece] pieces, auto recexpr = ast::expr_rec(astfields, option::none[@ast::expr]); ret @rec(id=cx.next_id(), node=recexpr, span=sp); } - fn make_path_vec(str ident) -> str[] { + fn make_path_vec(str ident) -> vec[str] { // FIXME: #fmt can't currently be used from within std // because we're explicitly referencing the 'std' crate here - ret ~["std", "extfmt", "rt", ident]; + ret ["std", "extfmt", "rt", ident]; } fn make_rt_path_expr(&ext_ctxt cx, span sp, str ident) -> @ast::expr { diff --git a/src/comp/syntax/ext/simplext.rs b/src/comp/syntax/ext/simplext.rs index 53b37da6c27..e214524f0b7 100644 --- a/src/comp/syntax/ext/simplext.rs +++ b/src/comp/syntax/ext/simplext.rs @@ -1,7 +1,6 @@ use std; import codemap::span; -import std::ivec; import std::vec; import std::option; import vec::map; @@ -51,7 +50,7 @@ fn subst_ident(&ext_ctxt cx, &vec[@ast::expr] args, fn subst_path(&ext_ctxt cx, &vec[@ast::expr] args, @vec[ident] param_names, &path_ p, ast_fold fld) -> path_ { // Don't substitute into qualified names. - if (ivec::len(p.types) > 0u || ivec::len(p.idents) != 1u) { ret p; } + if (len(p.types) > 0u || len(p.idents) != 1u) { ret p; } alt (position(p.idents.(0), *param_names)) { case (some[uint](?idx)) { alt (args.(idx).node) { @@ -76,8 +75,7 @@ fn subst_expr(&ext_ctxt cx, &vec[@ast::expr] args, @vec[ident] param_names, ret alt(e) { case (expr_path(?p)){ // Don't substitute into qualified names. - if (ivec::len(p.node.types) > 0u || - ivec::len(p.node.idents) != 1u) { e } + if (len(p.node.types) > 0u || len(p.node.idents) != 1u) { e } alt (position(p.node.idents.(0), *param_names)) { case (some[uint](?idx)) { args.(idx).node |
