Skip to content

Commit 2124e9b

Browse files
hosseind75hosseind88
authored andcommitted
rebase with master
1 parent 15663a4 commit 2124e9b

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

compiler/rustc_driver/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,9 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
12141214
// If backtraces are enabled, also print the query stack
12151215
let backtrace = env::var_os("RUST_BACKTRACE").map(|x| &x != "0").unwrap_or(false);
12161216

1217-
TyCtxt::try_print_query_stack(&handler, Some(2), Some(backtrace));
1217+
let num_frames = if backtrace { None } else { Some(2) };
1218+
1219+
TyCtxt::try_print_query_stack(&handler, num_frames);
12181220

12191221
#[cfg(windows)]
12201222
unsafe {

compiler/rustc_middle/src/ty/query/plumbing.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,15 @@ impl<'tcx> TyCtxt<'tcx> {
124124
})
125125
}
126126

127+
<<<<<<< HEAD
127128
pub fn try_print_query_stack(
128129
handler: &Handler,
129130
num_frames: Option<usize>,
130131
backtrace: Option<bool>,
131132
) {
133+
=======
134+
pub fn try_print_query_stack(handler: &Handler, num_frames: Option<usize>) {
135+
>>>>>>> 15827338aa231fd408561bf5db8d8eea85d1a51a
132136
eprintln!("query stack during panic:");
133137

134138
// Be careful reyling on global state here: this code is called from
@@ -142,7 +146,11 @@ impl<'tcx> TyCtxt<'tcx> {
142146
let mut i = 0;
143147

144148
while let Some(query) = current_query {
149+
<<<<<<< HEAD
145150
if backtrace.unwrap() == false && i == num_frames.unwrap() {
151+
=======
152+
if num_frames == Some(i) {
153+
>>>>>>> 15827338aa231fd408561bf5db8d8eea85d1a51a
146154
break;
147155
}
148156
let query_info =

src/tools/clippy/src/driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
277277
// If backtraces are enabled, also print the query stack
278278
let backtrace = env::var_os("RUST_BACKTRACE").map_or(false, |x| &x != "0");
279279

280-
TyCtxt::try_print_query_stack(&handler, Some(2), Some(backtrace));
280+
let num_frames = if backtrace { None } else { Some(2) };
281+
282+
TyCtxt::try_print_query_stack(&handler, num_frames);
281283
}
282284

283285
fn toolchain_path(home: Option<String>, toolchain: Option<String>) -> Option<PathBuf> {

0 commit comments

Comments
 (0)