librustc: De-@mut CrateContext::finished_tydescs.

This commit is contained in:
Patrick Walton 2013-12-18 18:35:33 -08:00
parent 462a791c34
commit fc92f92572
2 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,7 @@ use middle::trans::type_::Type;
use util::sha2::Sha256;
use std::cell::RefCell;
use std::cell::{Cell, RefCell};
use std::c_str::ToCStr;
use std::hashmap::{HashMap, HashSet};
use std::local_data;
@ -55,7 +55,7 @@ pub struct CrateContext {
tydescs: RefCell<HashMap<ty::t, @mut tydesc_info>>,
// Set when running emit_tydescs to enforce that no more tydescs are
// created.
finished_tydescs: bool,
finished_tydescs: Cell<bool>,
// Track mapping of external ids to local items imported for inlining
external: RefCell<HashMap<ast::DefId, Option<ast::NodeId>>>,
// Backwards version of the `external` map (inlined items to where they
@ -189,7 +189,7 @@ impl CrateContext {
item_symbols: RefCell::new(HashMap::new()),
link_meta: link_meta,
tydescs: RefCell::new(HashMap::new()),
finished_tydescs: false,
finished_tydescs: Cell::new(false),
external: RefCell::new(HashMap::new()),
external_srcs: RefCell::new(HashMap::new()),
non_inlineable_statics: RefCell::new(HashSet::new()),

View File

@ -589,7 +589,7 @@ pub fn incr_refcnt_of_boxed(cx: @Block, box_ptr: ValueRef) {
pub fn declare_tydesc(ccx: &mut CrateContext, t: ty::t) -> @mut tydesc_info {
// If emit_tydescs already ran, then we shouldn't be creating any new
// tydescs.
assert!(!ccx.finished_tydescs);
assert!(!ccx.finished_tydescs.get());
let llty = type_of(ccx, t);
@ -694,7 +694,7 @@ pub fn make_generic_glue(ccx: @mut CrateContext,
pub fn emit_tydescs(ccx: &mut CrateContext) {
let _icx = push_ctxt("emit_tydescs");
// As of this point, allow no more tydescs to be created.
ccx.finished_tydescs = true;
ccx.finished_tydescs.set(true);
let glue_fn_ty = Type::generic_glue_fn(ccx).ptr_to();
let mut tyds = ccx.tydescs.borrow_mut();
for (_, &val) in tyds.get().iter() {