@@ -303,7 +303,7 @@ struct ctxt_ {
303
303
/// Despite its name, `items` does not only map NodeId to an item but
304
304
/// also to expr/stmt/local/arg/etc
305
305
items : ast_map:: map ,
306
- intrinsic_defs : @ mut HashMap < ast:: DefId , t > ,
306
+ intrinsic_defs : RefCell < HashMap < ast:: DefId , t > > ,
307
307
freevars : freevars:: freevar_map ,
308
308
tcache : type_cache ,
309
309
rcache : creader_cache ,
@@ -989,7 +989,7 @@ pub fn mk_ctxt(s: session::Session,
989
989
trait_refs : RefCell :: new ( HashMap :: new ( ) ) ,
990
990
trait_defs : RefCell :: new ( HashMap :: new ( ) ) ,
991
991
items : amap,
992
- intrinsic_defs : @ mut HashMap :: new ( ) ,
992
+ intrinsic_defs : RefCell :: new ( HashMap :: new ( ) ) ,
993
993
freevars : freevars,
994
994
tcache : @mut HashMap :: new ( ) ,
995
995
rcache : mk_rcache ( ) ,
@@ -4417,14 +4417,16 @@ pub fn count_traits_and_supertraits(tcx: ctxt,
4417
4417
4418
4418
pub fn get_tydesc_ty ( tcx : ctxt ) -> Result < t , ~str > {
4419
4419
tcx. lang_items . require ( TyDescStructLangItem ) . map ( |tydesc_lang_item| {
4420
- tcx. intrinsic_defs . find_copy ( & tydesc_lang_item)
4420
+ let intrinsic_defs = tcx. intrinsic_defs . borrow ( ) ;
4421
+ intrinsic_defs. get ( ) . find_copy ( & tydesc_lang_item)
4421
4422
. expect ( "Failed to resolve TyDesc" )
4422
4423
} )
4423
4424
}
4424
4425
4425
4426
pub fn get_opaque_ty ( tcx : ctxt ) -> Result < t , ~str > {
4426
4427
tcx. lang_items . require ( OpaqueStructLangItem ) . map ( |opaque_lang_item| {
4427
- tcx. intrinsic_defs . find_copy ( & opaque_lang_item)
4428
+ let intrinsic_defs = tcx. intrinsic_defs . borrow ( ) ;
4429
+ intrinsic_defs. get ( ) . find_copy ( & opaque_lang_item)
4428
4430
. expect ( "Failed to resolve Opaque" )
4429
4431
} )
4430
4432
}
0 commit comments