Skip to content

Commit 73d8f00

Browse files
author
hosseind88
committed
change condition for end of query stack message
1 parent 42ebae3 commit 73d8f00

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ impl<'tcx> TyCtxt<'tcx> {
130130
// Be careful reyling on global state here: this code is called from
131131
// a panic hook, which means that the global `Handler` may be in a weird
132132
// state if it was responsible for triggering the panic.
133+
let mut i = 0;
133134
ty::tls::with_context_opt(|icx| {
134135
if let Some(icx) = icx {
135136
let query_map = icx.tcx.queries.try_collect_active_jobs();
136137

137138
let mut current_query = icx.query;
138-
let mut i = 0;
139139

140140
while let Some(query) = current_query {
141141
if Some(i) == num_frames {
@@ -166,10 +166,10 @@ impl<'tcx> TyCtxt<'tcx> {
166166
}
167167
});
168168

169-
if num_frames != None {
170-
eprintln!("we're just showing a limited slice of the query stack");
171-
} else {
169+
if num_frames == None || num_frames >= Some(i) {
172170
eprintln!("end of query stack");
171+
} else {
172+
eprintln!("we're just showing a limited slice of the query stack");
173173
}
174174
}
175175
}

0 commit comments

Comments
 (0)