diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-01-11 15:18:01 -0800 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-01-11 15:19:05 -0800 |
| commit | cfa62cd5ee65a466e88a6fabf92079e9b85f43e5 (patch) | |
| tree | 6b77995593e77d1ea0c1b04aff734ca8dd299fd7 | |
| parent | 1b1700f44b88225bc3557e1ca497644b9852e268 (diff) | |
| download | rust-cfa62cd5ee65a466e88a6fabf92079e9b85f43e5.tar.gz rust-cfa62cd5ee65a466e88a6fabf92079e9b85f43e5.zip | |
Make ast_util::path_name_i take a slice vector, eliminate a bad copy
| -rw-r--r-- | src/librustc/front/test.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/ast_util.rs | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc/front/test.rs b/src/librustc/front/test.rs index 81f748a3e60..870a7d6c593 100644 --- a/src/librustc/front/test.rs +++ b/src/librustc/front/test.rs @@ -364,10 +364,9 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr { debug!("encoding %s", ast_util::path_name_i(path, cx.sess.parse_sess.interner)); - // XXX: Bad copy of `path`. let name_lit: ast::lit = nospan(ast::lit_str(@ast_util::path_name_i( - copy path, cx.sess.parse_sess.interner))); + path, cx.sess.parse_sess.interner))); let name_expr_inner: @ast::expr = @{id: cx.sess.next_node_id(), callee_id: cx.sess.next_node_id(), diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 1a34fe29a71..898c89ff2c8 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -46,7 +46,7 @@ pure fn dummy_sp() -> span { return mk_sp(BytePos(0), BytePos(0)); } -pure fn path_name_i(idents: ~[ident], intr: @token::ident_interner) -> ~str { +pure fn path_name_i(idents: &[ident], intr: @token::ident_interner) -> ~str { // FIXME: Bad copies (#2543 -- same for everything else that says "bad") str::connect(idents.map(|i| *intr.get(*i)), ~"::") } |
