RUST_BACKTRACE on WSL on Windows

 Hello,

So I set RUST_BACKTRACE=1 on WSL on Windows, but it does not display a backtrace:

thread 'main' panicked at 'internal error: entered unreachable code', /home/oliverr/.cargo/registry/src/github.com-1ecc6299db9ec823/bgzip-0.1.0/src/read.rs:126:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
oliverr@GP7E3-45D:/mnt/c/Users/oliverr/git/selene$ echo $RUST_BACKTRACE
1

And I'm not sure whether that's supposed to be necessary or not, but I also tried rebuilding it after setting RUST_BACKTRACE=1

Any ideas? Thanks!

 Best, Oliver

If you merely set a variable in bash and many other shells, it will only be a local variable, not inherited by child processes. I'm guessing you need to export RUST_BACKTRACE=1. Or you can combine the command to set it just for that invocation, like RUST_BACKTRACE=1 cargo run ...

1 Like

Ah, thanks, that's it. I thought export was only for child shells.