Skip to content

Commit 2418cc0

Browse files
committed
librustc: De-@mut the crate context's do_not_commit_warning_issued
1 parent 61768de commit 2418cc0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc/middle/trans/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ impl FunctionContext {
307307
}
308308

309309
pub fn warn_not_to_commit(ccx: &mut CrateContext, msg: &str) {
310-
if !ccx.do_not_commit_warning_issued {
311-
ccx.do_not_commit_warning_issued = true;
310+
if !ccx.do_not_commit_warning_issued.get() {
311+
ccx.do_not_commit_warning_issued.set(true);
312312
ccx.sess.warn(msg.to_str() + " -- do not commit like this!");
313313
}
314314
}

src/librustc/middle/trans/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub struct CrateContext {
112112
// is not emitted by LLVM's GC pass when no functions use GC.
113113
uses_gc: bool,
114114
dbg_cx: Option<debuginfo::CrateDebugContext>,
115-
do_not_commit_warning_issued: bool
115+
do_not_commit_warning_issued: Cell<bool>,
116116
}
117117

118118
impl CrateContext {
@@ -232,7 +232,7 @@ impl CrateContext {
232232
crate_map_name: crate_map_name,
233233
uses_gc: false,
234234
dbg_cx: dbg_cx,
235-
do_not_commit_warning_issued: false
235+
do_not_commit_warning_issued: Cell::new(false),
236236
}
237237
}
238238
}

0 commit comments

Comments
 (0)