From 4af2d90af59bb5e28e5d114d8a6004d68fad3bd5 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 1 May 2013 10:29:47 -0400 Subject: add an option to debug borrows (RUST_DEBUG_BORROW) so you can find out where the offending borrow occurred. This ... still needs some work. --- src/rt/rust_env.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/rt/rust_env.cpp') diff --git a/src/rt/rust_env.cpp b/src/rt/rust_env.cpp index 041b4efac52..e6fe35609ec 100644 --- a/src/rt/rust_env.cpp +++ b/src/rt/rust_env.cpp @@ -24,6 +24,7 @@ #define RUST_SEED "RUST_SEED" #define RUST_POISON_ON_FREE "RUST_POISON_ON_FREE" #define RUST_DEBUG_MEM "RUST_DEBUG_MEM" +#define RUST_DEBUG_BORROWS "RUST_DEBUG_BORROWS" #if defined(__WIN32__) static int @@ -130,6 +131,7 @@ load_env(int argc, char **argv) { env->argc = argc; env->argv = argv; env->debug_mem = getenv(RUST_DEBUG_MEM) != NULL; + env->debug_borrows = getenv(RUST_DEBUG_BORROWS) != NULL; return env; } -- cgit 1.4.1-3-g733a5