pub struct ty_abbrev {
pos: uint,
len: uint,
- s: @str
+ s: ~str
}
pub enum abbrev_ctxt {
let short_names_cache = cx.tcx.short_names_cache.borrow();
result_str_opt = short_names_cache.get()
.find(&t)
- .map(|result| *result);
+ .map(|result| {
+ (*result).clone()
+ });
}
let result_str = match result_str_opt {
Some(s) => s,
None => {
let wr = &mut MemWriter::new();
enc_sty(wr, cx, &ty::get(t).sty);
- let s = str::from_utf8(wr.get_ref()).unwrap().to_managed();
+ let s = str::from_utf8(wr.get_ref()).unwrap();
let mut short_names_cache = cx.tcx
.short_names_cache
.borrow_mut();
- short_names_cache.get().insert(t, s);
- s
+ short_names_cache.get().insert(t, s.to_str());
+ s.to_str()
}
};
w.write(result_str.as_bytes());
let abbrev_len = 3 + estimate_sz(pos) + estimate_sz(len);
if abbrev_len < len {
// I.e. it's actually an abbreviation.
- let s = format!("\\#{:x}:{:x}\\#", pos, len).to_managed();
+ let s = format!("\\#{:x}:{:x}\\#", pos, len);
let a = ty_abbrev { pos: pos as uint,
len: len as uint,
s: s };
freevars: RefCell<freevars::freevar_map>,
tcache: type_cache,
rcache: creader_cache,
- short_names_cache: RefCell<HashMap<t, @str>>,
+ short_names_cache: RefCell<HashMap<t, ~str>>,
needs_unwind_cleanup_cache: RefCell<HashMap<t, bool>>,
tc_cache: RefCell<HashMap<uint, TypeContents>>,
ast_ty_to_ty_cache: RefCell<HashMap<NodeId, ast_ty_to_ty_cache_entry>>,