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
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(_) => ~"[]",
}
-> 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))));
}
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()));
}
}
}
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()));
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);
}
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);
}
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() + "`");
}
}