Skip to content

Commit cfa62cd

Browse files
committed
Make ast_util::path_name_i take a slice vector, eliminate a bad copy
1 parent 1b1700f commit cfa62cd

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/librustc/front/test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,9 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr {
364364
debug!("encoding %s", ast_util::path_name_i(path,
365365
cx.sess.parse_sess.interner));
366366

367-
// XXX: Bad copy of `path`.
368367
let name_lit: ast::lit =
369368
nospan(ast::lit_str(@ast_util::path_name_i(
370-
copy path, cx.sess.parse_sess.interner)));
369+
path, cx.sess.parse_sess.interner)));
371370
let name_expr_inner: @ast::expr =
372371
@{id: cx.sess.next_node_id(),
373372
callee_id: cx.sess.next_node_id(),

src/libsyntax/ast_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pure fn dummy_sp() -> span { return mk_sp(BytePos(0), BytePos(0)); }
4646

4747

4848

49-
pure fn path_name_i(idents: ~[ident], intr: @token::ident_interner) -> ~str {
49+
pure fn path_name_i(idents: &[ident], intr: @token::ident_interner) -> ~str {
5050
// FIXME: Bad copies (#2543 -- same for everything else that says "bad")
5151
str::connect(idents.map(|i| *intr.get(*i)), ~"::")
5252
}

0 commit comments

Comments
 (0)