Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,9 @@ pub fn install_ice_hook(
// opt in to less-verbose backtraces by manually setting "RUST_BACKTRACE"
// (e.g. `RUST_BACKTRACE=1`)
if env::var_os("RUST_BACKTRACE").is_none() {
if env!("CFG_RELEASE_CHANNEL") == "dev" {
// HACK: this check is extremely dumb, but we don't really need it to be smarter since this should only happen in the test suite anyway.
let ui_testing = std::env::args().any(|arg| arg == "-Zui-testing");
if env!("CFG_RELEASE_CHANNEL") == "dev" && !ui_testing {
panic::set_backtrace_style(panic::BacktraceStyle::Short);
} else {
panic::set_backtrace_style(panic::BacktraceStyle::Full);
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/panics/default-backtrace-ice.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//@ unset-rustc-env:RUST_BACKTRACE
//@ compile-flags:-Z treat-err-as-bug=1
//@ error-pattern:stack backtrace:
// Verify this is a full backtrace, not a short backtrace.
//@ error-pattern:__rust_begin_short_backtrace
//@ failure-status:101
//@ ignore-msvc
//@ normalize-stderr-test: "note: .*" -> ""
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/panics/default-backtrace-ice.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: internal compiler error[E0425]: cannot find value `missing_ident` in this scope
--> $DIR/default-backtrace-ice.rs:21:13
--> $DIR/default-backtrace-ice.rs:23:13
|
LL | fn main() { missing_ident; }
| ^^^^^^^^^^^^^ not found in this scope
Expand Down
Loading