about summary refs log tree commit diff
path: root/src/libstd/rt/env.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-08-11 18:54:23 -0700
committerBrian Anderson <banderson@mozilla.com>2013-08-19 20:39:39 -0700
commit0f9ab936423cfc427ff30e87efc7ca794fec8bcf (patch)
tree01a0efa5b80b7440f4eca606e506ea197687a9ab /src/libstd/rt/env.rs
parent2ec9b8ce2f08dd9b931bd084f83fd3a4d0c3e8c7 (diff)
std: Restore dynamic borrow tracking
Diffstat (limited to 'src/libstd/rt/env.rs')
-rw-r--r--src/libstd/rt/env.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstd/rt/env.rs b/src/libstd/rt/env.rs
index 3ca39acbfcd..5b840655120 100644
--- a/src/libstd/rt/env.rs
+++ b/src/libstd/rt/env.rs
@@ -18,6 +18,7 @@ use os;
 // They are expected to be initialized once then left alone.
 
 static mut MIN_STACK: uint = 2000000;
+static mut DEBUG_BORROW: bool = false;
 
 pub fn init() {
     unsafe {
@@ -28,9 +29,17 @@ pub fn init() {
             },
             None => ()
         }
+        match os::getenv("RUST_DEBUG_BORROW") {
+            Some(_) => DEBUG_BORROW = true,
+            None => ()
+        }
     }
 }
 
 pub fn min_stack() -> uint {
     unsafe { MIN_STACK }
 }
+
+pub fn debug_borrow() -> bool {
+    unsafe { DEBUG_BORROW }
+}