提交 cfa62cd5 编写于 作者: T Tim Chevalier

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

上级 1b1700f4
...@@ -364,10 +364,9 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr { ...@@ -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, debug!("encoding %s", ast_util::path_name_i(path,
cx.sess.parse_sess.interner)); cx.sess.parse_sess.interner));
// XXX: Bad copy of `path`.
let name_lit: ast::lit = let name_lit: ast::lit =
nospan(ast::lit_str(@ast_util::path_name_i( 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 = let name_expr_inner: @ast::expr =
@{id: cx.sess.next_node_id(), @{id: cx.sess.next_node_id(),
callee_id: cx.sess.next_node_id(), callee_id: cx.sess.next_node_id(),
......
...@@ -46,7 +46,7 @@ ...@@ -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") // FIXME: Bad copies (#2543 -- same for everything else that says "bad")
str::connect(idents.map(|i| *intr.get(*i)), ~"::") str::connect(idents.map(|i| *intr.get(*i)), ~"::")
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册