librustc: De-@mut the crate context's do_not_commit_warning_issued

This commit is contained in:
Patrick Walton 2013-12-19 16:27:58 -08:00
parent 61768de5e9
commit 2418cc0212
2 changed files with 4 additions and 4 deletions

View File

@ -307,8 +307,8 @@ impl FunctionContext {
}
pub fn warn_not_to_commit(ccx: &mut CrateContext, msg: &str) {
if !ccx.do_not_commit_warning_issued {
ccx.do_not_commit_warning_issued = true;
if !ccx.do_not_commit_warning_issued.get() {
ccx.do_not_commit_warning_issued.set(true);
ccx.sess.warn(msg.to_str() + " -- do not commit like this!");
}
}

View File

@ -112,7 +112,7 @@ pub struct CrateContext {
// is not emitted by LLVM's GC pass when no functions use GC.
uses_gc: bool,
dbg_cx: Option<debuginfo::CrateDebugContext>,
do_not_commit_warning_issued: bool
do_not_commit_warning_issued: Cell<bool>,
}
impl CrateContext {
@ -232,7 +232,7 @@ impl CrateContext {
crate_map_name: crate_map_name,
uses_gc: false,
dbg_cx: dbg_cx,
do_not_commit_warning_issued: false
do_not_commit_warning_issued: Cell::new(false),
}
}
}