Skip to content

Commit

Permalink
Merge pull request #1961 from bjorn3/backtrace_trigger_change
Browse files Browse the repository at this point in the history
Disable non-panic error backtraces when RUSTUP_NO_BACKTRACE is set
  • Loading branch information
kinnison authored Aug 25, 2019
2 parents d62e504 + 583ffd5 commit d08d326
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@ Command | Description
- `RUSTUP_UNPACK_RAM` *unstable* (default 400M, min 100M)
Caps the amount of RAM rustup will use for IO tasks while unpacking.

- `RUSTUP_NO_BACKTRACE`
Disables backtraces on non-panic errors even when `RUST_BACKTRACE` is set.

## Other installation methods

The primary installation method, as described at https://rustup.rs, differs by platform:
Expand Down
4 changes: 4 additions & 0 deletions src/cli/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ pub fn report_error(e: &Error) {
}

fn show_backtrace() -> bool {
if let Ok(true) = env::var("RUSTUP_NO_BACKTRACE").map(|s| s == "1") {
return false;
}

if let Ok(true) = env::var("RUST_BACKTRACE").map(|s| s == "1") {
return true;
}
Expand Down

0 comments on commit d08d326

Please sign in to comment.