From d60b7e29f7f80674984c8d2f3567b15253b14f2f Mon Sep 17 00:00:00 2001 From: hosseind75 Date: Wed, 23 Sep 2020 19:08:21 +0330 Subject: [PATCH] fix show we're just showing... message instead of the end of query stack message when RUST_BACKTRACE=0 --- compiler/rustc_middle/src/ty/query/plumbing.rs | 6 +++++- src/test/ui/pattern/const-pat-ice.stderr | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/test/ui/pattern/const-pat-ice.stderr diff --git a/compiler/rustc_middle/src/ty/query/plumbing.rs b/compiler/rustc_middle/src/ty/query/plumbing.rs index 239d5bce607..d5fbcf6c9b1 100644 --- a/compiler/rustc_middle/src/ty/query/plumbing.rs +++ b/compiler/rustc_middle/src/ty/query/plumbing.rs @@ -170,7 +170,11 @@ impl<'tcx> TyCtxt<'tcx> { } }); - eprintln!("end of query stack"); + if num_frames != None { + eprintln!("we're just showing a limited slice of the query stack"); + } else { + eprintln!("end of query stack"); + } } } diff --git a/src/test/ui/pattern/const-pat-ice.stderr b/src/test/ui/pattern/const-pat-ice.stderr new file mode 100644 index 00000000000..90497db519c --- /dev/null +++ b/src/test/ui/pattern/const-pat-ice.stderr @@ -0,0 +1,17 @@ +thread 'rustc' panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())', compiler/rustc_mir_build/src/thir/pattern/_match.rs:LL:CC +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + +error: internal compiler error: unexpected panic + +note: the compiler unexpectedly panicked. this is a bug. + +note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md + +note: rustc VERSION running on TARGET + +note: compiler flags: FLAGS + +query stack during panic: +#0 [check_match] match-checking `main` +#1 [analysis] running analysis passes on this crate +we're just showing a limited slice of the query stack