Currently on Windows when a program panics and the default panic handler is run one of the lines it prints is: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
The problem is this is not the syntax that powershell (which I think is the default and largest shell used on Windows) uses to set environment variables.
I think note: `RUST_BACKTRACE=1` (or PowerShell `$env:RUST_BACKTRACE=1`) environment variable to display a backtrace would be more correct and better for beginners.
Powershell isn't only available on Windows, so checking the shell rather than the OS would be better. And on Windows, there is also cmd.exe, so the suggestion might be invalid for some people.
Currently on Windows when a program panics and the default panic handler is run one of the lines it prints is:
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
.The problem is this is not the syntax that powershell (which I think is the default and largest shell used on Windows) uses to set environment variables.
I think
note: `RUST_BACKTRACE=1` (or PowerShell `$env:RUST_BACKTRACE=1`) environment variable to display a backtrace
would be more correct and better for beginners.Should be pretty simple change adding a different
cfg!
branch for following code https://github.com/rust-lang/rust/blob/352e621368c31d7b4a6362e081586cdb931ba020/library/std/src/sys_common/backtrace.rs#L104-L110