add an option to debug borrows (RUST_DEBUG_BORROW) so you can

find out where the offending borrow occurred. This ... still needs
some work.
This commit is contained in:
Niko Matsakis
2013-05-01 10:29:47 -04:00
parent 84861101ec
commit 4af2d90af5
10 changed files with 121 additions and 14 deletions

View File

@@ -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;
}