about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2018-12-02 18:09:26 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2019-03-29 17:17:12 +0100
commitab8f1527e485d0de49139ca7b9d42c320991a53b (patch)
tree563ca8e6f54fd7e422f113c3ea732ce94a45c655 /src/librustc_codegen_ssa
parentf1fe9253e2b9ed072af6bc2d80feb6be0ffee8a5 (diff)
downloadrust-ab8f1527e485d0de49139ca7b9d42c320991a53b.tar.gz
rust-ab8f1527e485d0de49139ca7b9d42c320991a53b.zip
Remove internal mutability from source_locations_enabled
Diffstat (limited to 'src/librustc_codegen_ssa')
-rw-r--r--src/librustc_codegen_ssa/debuginfo.rs9
-rw-r--r--src/librustc_codegen_ssa/mir/mod.rs2
2 files changed, 5 insertions, 6 deletions
diff --git a/src/librustc_codegen_ssa/debuginfo.rs b/src/librustc_codegen_ssa/debuginfo.rs
index c4531ff90ae..aa7cdbed994 100644
--- a/src/librustc_codegen_ssa/debuginfo.rs
+++ b/src/librustc_codegen_ssa/debuginfo.rs
@@ -1,6 +1,5 @@
 use syntax_pos::{BytePos, Span};
 use rustc::hir::def_id::CrateNum;
-use std::cell::Cell;
 
 pub enum FunctionDebugContext<D> {
     RegularContext(FunctionDebugContextData<D>),
@@ -36,10 +35,10 @@ impl<D> FunctionDebugContext<D> {
 /// they are disabled when beginning to codegen a new function. This functions
 /// switches source location emitting on and must therefore be called before the
 /// first real statement/expression of the function is codegened.
-pub fn start_emitting_source_locations<D>(dbg_context: &FunctionDebugContext<D>) {
+pub fn start_emitting_source_locations<D>(dbg_context: &mut FunctionDebugContext<D>) {
     match *dbg_context {
-        FunctionDebugContext::RegularContext(ref data) => {
-            data.source_locations_enabled.set(true)
+        FunctionDebugContext::RegularContext(ref mut data) => {
+            data.source_locations_enabled = true;
         },
         _ => { /* safe to ignore */ }
     }
@@ -47,7 +46,7 @@ pub fn start_emitting_source_locations<D>(dbg_context: &FunctionDebugContext<D>)
 
 pub struct FunctionDebugContextData<D> {
     pub fn_metadata: D,
-    pub source_locations_enabled: Cell<bool>,
+    pub source_locations_enabled: bool,
     pub defining_crate: CrateNum,
 }
 
diff --git a/src/librustc_codegen_ssa/mir/mod.rs b/src/librustc_codegen_ssa/mir/mod.rs
index 62bbfa316b5..15597542d49 100644
--- a/src/librustc_codegen_ssa/mir/mod.rs
+++ b/src/librustc_codegen_ssa/mir/mod.rs
@@ -334,7 +334,7 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
     // Up until here, IR instructions for this function have explicitly not been annotated with
     // source code location, so we don't step into call setup code. From here on, source location
     // emitting should be enabled.
-    debuginfo::start_emitting_source_locations(&fx.debug_context);
+    debuginfo::start_emitting_source_locations(&mut fx.debug_context);
 
     let rpo = traversal::reverse_postorder(&mir);
     let mut visited = BitSet::new_empty(mir.basic_blocks().len());