librustc: De-@mut
intrinsic_defs
This commit is contained in:
parent
2ead970b21
commit
2612d76d22
@ -303,7 +303,7 @@ struct ctxt_ {
|
||||
/// Despite its name, `items` does not only map NodeId to an item but
|
||||
/// also to expr/stmt/local/arg/etc
|
||||
items: ast_map::map,
|
||||
intrinsic_defs: @mut HashMap<ast::DefId, t>,
|
||||
intrinsic_defs: RefCell<HashMap<ast::DefId, t>>,
|
||||
freevars: freevars::freevar_map,
|
||||
tcache: type_cache,
|
||||
rcache: creader_cache,
|
||||
@ -989,7 +989,7 @@ pub fn mk_ctxt(s: session::Session,
|
||||
trait_refs: RefCell::new(HashMap::new()),
|
||||
trait_defs: RefCell::new(HashMap::new()),
|
||||
items: amap,
|
||||
intrinsic_defs: @mut HashMap::new(),
|
||||
intrinsic_defs: RefCell::new(HashMap::new()),
|
||||
freevars: freevars,
|
||||
tcache: @mut HashMap::new(),
|
||||
rcache: mk_rcache(),
|
||||
@ -4417,14 +4417,16 @@ pub fn count_traits_and_supertraits(tcx: ctxt,
|
||||
|
||||
pub fn get_tydesc_ty(tcx: ctxt) -> Result<t, ~str> {
|
||||
tcx.lang_items.require(TyDescStructLangItem).map(|tydesc_lang_item| {
|
||||
tcx.intrinsic_defs.find_copy(&tydesc_lang_item)
|
||||
let intrinsic_defs = tcx.intrinsic_defs.borrow();
|
||||
intrinsic_defs.get().find_copy(&tydesc_lang_item)
|
||||
.expect("Failed to resolve TyDesc")
|
||||
})
|
||||
}
|
||||
|
||||
pub fn get_opaque_ty(tcx: ctxt) -> Result<t, ~str> {
|
||||
tcx.lang_items.require(OpaqueStructLangItem).map(|opaque_lang_item| {
|
||||
tcx.intrinsic_defs.find_copy(&opaque_lang_item)
|
||||
let intrinsic_defs = tcx.intrinsic_defs.borrow();
|
||||
intrinsic_defs.get().find_copy(&opaque_lang_item)
|
||||
.expect("Failed to resolve Opaque")
|
||||
})
|
||||
}
|
||||
|
@ -76,7 +76,8 @@ pub fn collect_item_types(ccx: @mut CrateCtxt, crate: &ast::Crate) {
|
||||
lang_item: ast::DefId) {
|
||||
let ty::ty_param_bounds_and_ty { ty: ty, .. } =
|
||||
ccx.get_item_ty(lang_item);
|
||||
ccx.tcx.intrinsic_defs.insert(lang_item, ty);
|
||||
let mut intrinsic_defs = ccx.tcx.intrinsic_defs.borrow_mut();
|
||||
intrinsic_defs.get().insert(lang_item, ty);
|
||||
}
|
||||
|
||||
match ccx.tcx.lang_items.ty_desc() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user