debugtrace 0.1.0

Enables backtraces to be attached to values in debug and test builds without incurring a cost in release or bench builds
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::env;

fn main() {
    let enable_trace = match env::var("PROFILE").unwrap().as_ref() {
        "debug" => true,
        "test"  => true,
        _       => false,
    };

    if enable_trace {
        // We enable the stacktrace debug-printing here:
        println!("cargo:rustc-cfg=feature=\"debug_print_trace\"");
    }
}