about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/const_eval
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-11-29 13:10:42 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-12-06 18:59:46 +0000
commit99348a5330cb4d6e3bb2e28badebd76561b8996f (patch)
tree4f203b0595506539c7247a0836e41db91221bb23 /compiler/rustc_const_eval/src/const_eval
parentfa99459b4286a2fb45dd1f224a9fc5788da84cfb (diff)
downloadrust-99348a5330cb4d6e3bb2e28badebd76561b8996f.tar.gz
rust-99348a5330cb4d6e3bb2e28badebd76561b8996f.zip
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
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
-rw-r--r--compiler/rustc_const_eval/src/const_eval/error.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs
index e3dfd72d5f0..c60d6e4fed9 100644
--- a/compiler/rustc_const_eval/src/const_eval/error.rs
+++ b/compiler/rustc_const_eval/src/const_eval/error.rs
@@ -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),
                             );