Make ast_util::path_name_i take a slice vector, eliminate a bad copy

This commit is contained in:
Tim Chevalier 2013-01-11 15:18:01 -08:00
parent 1b1700f44b
commit cfa62cd5ee
2 changed files with 2 additions and 3 deletions

View File

@ -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(),

View File

@ -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)), ~"::")
}