From cfa62cd5ee65a466e88a6fabf92079e9b85f43e5 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 11 Jan 2013 15:18:01 -0800 Subject: [PATCH] Make ast_util::path_name_i take a slice vector, eliminate a bad copy --- src/librustc/front/test.rs | 3 +-- 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 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)), ~"::") } -- GitLab