]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Remove uses of `interner_get` in librustc
authorPatrick Walton <pcwalton@mimiga.net>
Sat, 1 Feb 2014 00:03:55 +0000 (16:03 -0800)
committerHuon Wilson <dbau.pp+github@gmail.com>
Sat, 1 Feb 2014 14:44:49 +0000 (01:44 +1100)
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/check/_match.rs
src/librustc/middle/typeck/check/method.rs
src/librustc/middle/typeck/check/mod.rs

index c34f5c2f56b04d9e688a8d05497f44379c878497..68e205ebb6ec61c03b1cf0be68e0c685c2880beb 100644 (file)
@@ -796,8 +796,9 @@ pub fn append_loan_path_to_str(&self,
                 self.append_loan_path_to_str_from_interior(lp_base, out);
                 match fname {
                     mc::NamedField(ref fname) => {
+                        let string = token::get_ident(*fname);
                         out.push_char('.');
-                        out.push_str(token::interner_get(*fname));
+                        out.push_str(string.get());
                     }
                     mc::PositionalField(idx) => {
                         out.push_char('#'); // invent a notation here
index ce1840283b2e4e3691c7f373dbeee6cc70159b8d..d98cf9795b22ce29a78d4ae1c2e5d342127f304a 100644 (file)
@@ -1233,7 +1233,10 @@ pub fn ptr_sigil(ptr: PointerKind) -> ~str {
 impl Repr for InteriorKind {
     fn repr(&self, _tcx: ty::ctxt) -> ~str {
         match *self {
-            InteriorField(NamedField(fld)) => token::interner_get(fld).to_owned(),
+            InteriorField(NamedField(fld)) => {
+                let string = token::get_ident(fld);
+                string.get().to_owned()
+            }
             InteriorField(PositionalField(i)) => format!("\\#{:?}", i),
             InteriorElement(_) => ~"[]",
         }
index 93bfe9c51e1dd1f40bc8de68e0fbc7d9690c5cf9..066be142f2499dd9d3b8f8036678b50aa39800eb 100644 (file)
@@ -3344,9 +3344,10 @@ pub fn field_idx_strict(tcx: ty::ctxt, name: ast::Name, fields: &[field])
                      -> uint {
     let mut i = 0u;
     for f in fields.iter() { if f.ident.name == name { return i; } i += 1u; }
+    let string = token::get_ident(name);
     tcx.sess.bug(format!(
         "No field named `{}` found in the list of fields `{:?}`",
-        token::interner_get(name),
+        string.get(),
         fields.map(|f| tcx.sess.str_of(f.ident))));
 }
 
index 9303bf80208a7843b8941c276c6dda5f920a94c3..37862943dd7d5edaac01bbe9e1b1e8ae0663b598 100644 (file)
@@ -339,9 +339,11 @@ pub fn check_struct_pat_fields(pcx: &pat_ctxt,
             if found_fields.contains(&i) {
                 continue;
             }
+
+            let string = token::get_ident(field.name);
             tcx.sess.span_err(span,
                               format!("pattern does not mention field `{}`",
-                                   token::interner_get(field.name)));
+                                      string.get()));
         }
     }
 }
index 398b4cca015b4e0bbb9f6ecb4a2505475edf23ae..09d04753def2249d93eaf6886baff272f76ae78d 100644 (file)
@@ -555,8 +555,10 @@ fn push_candidates_from_impl(&self,
                 return; // already visited
             }
         }
+
+        let method_name = token::get_ident(self.m_name);
         debug!("push_candidates_from_impl: {} {} {}",
-               token::interner_get(self.m_name),
+               method_name.get(),
                impl_info.ident.repr(self.tcx()),
                impl_info.methods.map(|m| m.ident).repr(self.tcx()));
 
index 7e8fa4e66713c5204bb019a96149b08502a106d6..121b0486fb1d9bee9ce87f988ea1158dc53f25cc 100644 (file)
@@ -2335,9 +2335,11 @@ fn check_field(fcx: @FnCtxt,
                 fcx.type_error_message(
                     expr.span,
                     |actual| {
+                        let string = token::get_ident(field);
                         format!("attempted to take value of method `{}` on type `{}` \
-                              (try writing an anonymous function)",
-                             token::interner_get(field), actual)
+                                 (try writing an anonymous function)",
+                                string.get(),
+                                actual)
                     },
                     expr_t, None);
             }
@@ -2346,9 +2348,11 @@ fn check_field(fcx: @FnCtxt,
                 fcx.type_error_message(
                     expr.span,
                     |actual| {
+                        let string = token::get_ident(field);
                         format!("attempted access of field `{}` on type `{}`, \
-                              but no field with that name was found",
-                             token::interner_get(field), actual)
+                                 but no field with that name was found",
+                                string.get(),
+                                actual)
                     },
                     expr_t, None);
             }
@@ -2428,8 +2432,8 @@ fn check_struct_or_variant_fields(fcx: @FnCtxt,
                     let name = class_field.name;
                     let (_, seen) = *class_field_map.get(&name);
                     if !seen {
-                        missing_fields.push(
-                            ~"`" + token::interner_get(name) + "`");
+                        let string = token::get_ident(name);
+                        missing_fields.push(~"`" + string.get() + "`");
                     }
                 }