about summary refs log tree commit diff
path: root/src/libsyntax/ext/fmt.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-06-13 03:02:55 +1000
committerHuon Wilson <dbau.pp+github@gmail.com>2013-06-13 10:20:52 +1000
commit096f6f56a8178bd7f4b69a2ea909838e782766fb (patch)
tree37513f0d39fdfb4d5a702a72abd7423c93c51cdf /src/libsyntax/ext/fmt.rs
parent641910dc1340b7786fd758282bac88639a58ddcd (diff)
Use @str instead of @~str in libsyntax and librustc. Fixes #5048.
This almost removes the StringRef wrapper, since all strings are
Equiv-alent now. Removes a lot of `/* bad */ copy *`'s, and converts
several things to be &'static str (the lint table and the intrinsics
table).

There are many instances of .to_managed(), unfortunately.
Diffstat (limited to 'src/libsyntax/ext/fmt.rs')
-rw-r--r--src/libsyntax/ext/fmt.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs
index b2ec3684b70..74496ac5359 100644
--- a/src/libsyntax/ext/fmt.rs
+++ b/src/libsyntax/ext/fmt.rs
@@ -274,12 +274,13 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span,
                    then there's no need for it to be mutable */
                 if i == 0 {
                     stms.push(cx.stmt_let(fmt_sp, npieces > 1,
-                                          ident, cx.expr_str_uniq(fmt_sp, s)));
+                                          ident, cx.expr_str_uniq(fmt_sp, s.to_managed())));
                 } else {
                     // we call the push_str function because the
                     // bootstrap doesnt't seem to work if we call the
                     // method.
-                    let args = ~[cx.expr_mut_addr_of(fmt_sp, buf()), cx.expr_str(fmt_sp, s)];
+                    let args = ~[cx.expr_mut_addr_of(fmt_sp, buf()),
+                                 cx.expr_str(fmt_sp, s.to_managed())];
                     let call = cx.expr_call_global(fmt_sp,
                                                    ~[core_ident,
                                                      str_ident,
@@ -303,7 +304,7 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span,
                    must be initialized as an empty string */
                 if i == 0 {
                     stms.push(cx.stmt_let(fmt_sp, true, ident,
-                                          cx.expr_str_uniq(fmt_sp, ~"")));
+                                          cx.expr_str_uniq(fmt_sp, @"")));
                 }
                 stms.push(cx.stmt_expr(make_new_conv(cx, fmt_sp, conv,
                                                      args[n], buf())));