Change CTFE backtraces to use note
instead of label
to preserve their order
labels are reordered within the file in which they are reported, which can mess up the stack trace
This commit is contained in:
parent
fa99459b42
commit
99348a5330
29 changed files with 1868 additions and 652 deletions
|
@ -123,14 +123,14 @@ impl<'tcx> ConstEvalErr<'tcx> {
|
|||
// Helper closure to print duplicated lines.
|
||||
let mut flush_last_line = |last_frame, times| {
|
||||
if let Some((line, span)) = last_frame {
|
||||
err.span_label(span, &line);
|
||||
err.span_note(span, &line);
|
||||
// Don't print [... additional calls ...] if the number of lines is small
|
||||
if times < 3 {
|
||||
for _ in 0..times {
|
||||
err.span_label(span, &line);
|
||||
err.span_note(span, &line);
|
||||
}
|
||||
} else {
|
||||
err.span_label(
|
||||
err.span_note(
|
||||
span,
|
||||
format!("[... {} additional calls {} ...]", times, &line),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue