summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-02-26 06:35:36 -0800
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-02-26 20:48:11 -0800
commit4ae91e2961ac7be50a346a6b0d724601878a9cd0 (patch)
tree90cb8dd7634d786c2ff6c7253dc1dc742c4f925e /src/libsyntax/parse/token.rs
parent8d239a256d39eb2527ddd40e34d14a2e1801fb61 (diff)
downloadrust-4ae91e2961ac7be50a346a6b0d724601878a9cd0.tar.gz
rust-4ae91e2961ac7be50a346a6b0d724601878a9cd0.zip
libsyntax: add explicit copies
Diffstat (limited to 'src/libsyntax/parse/token.rs')
-rw-r--r--src/libsyntax/parse/token.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 2b9df61120e..8b063314c9b 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -179,14 +179,14 @@ pub fn to_str(in: @ident_interner, t: &Token) -> ~str {
       }
       LIT_INT_UNSUFFIXED(i) => { i.to_str() }
       LIT_FLOAT(s, t) => {
-        let mut body = *in.get(s);
+        let mut body = copy *in.get(s);
         if body.ends_with(~".") {
             body = body + ~"0";  // `10.f` is not a float literal
         }
         body + ast_util::float_ty_to_str(t)
       }
       LIT_FLOAT_UNSUFFIXED(s) => {
-        let mut body = *in.get(s);
+        let mut body = copy *in.get(s);
         if body.ends_with(~".") {
             body = body + ~"0";  // `10.f` is not a float literal
         }
@@ -195,12 +195,12 @@ pub fn to_str(in: @ident_interner, t: &Token) -> ~str {
       LIT_STR(s) => { ~"\"" + str::escape_default(*in.get(s)) + ~"\"" }
 
       /* Name components */
-      IDENT(s, _) => *in.get(s),
+      IDENT(s, _) => copy *in.get(s),
       LIFETIME(s) => fmt!("'%s", *in.get(s)),
       UNDERSCORE => ~"_",
 
       /* Other */
-      DOC_COMMENT(s) => *in.get(s),
+      DOC_COMMENT(s) => copy *in.get(s),
       EOF => ~"<eof>",
       INTERPOLATED(ref nt) => {
         match nt {
@@ -476,7 +476,7 @@ pub fn temporary_keyword_table() -> HashMap<~str, ()> {
         ~"self", ~"static",
     ];
     for keys.each |word| {
-        words.insert(*word, ());
+        words.insert(copy *word, ());
     }
     words
 }
@@ -503,7 +503,7 @@ pub fn strict_keyword_table() -> HashMap<~str, ()> {
         ~"while"
     ];
     for keys.each |word| {
-        words.insert(*word, ());
+        words.insert(copy *word, ());
     }
     words
 }
@@ -514,7 +514,7 @@ pub fn reserved_keyword_table() -> HashMap<~str, ()> {
         ~"be"
     ];
     for keys.each |word| {
-        words.insert(*word, ());
+        words.insert(copy *word, ());
     }
     words
 }