]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/const_eval.rs
Auto merge of #59199 - estebank:untrack-errors, r=eddyb
[rust.git] / src / librustc_mir / const_eval.rs
index 2e15f0de69f7019b064116ed0678daccadf3aa89..8c774e0d54cced74b57d1fb037c4127ed9df4b0e 100644 (file)
@@ -666,6 +666,7 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
                         tcx.at(tcx.def_span(def_id)),
                         "any use of this value will cause an error",
                         hir_id,
+                        Some(err.span),
                     )
                 },
                 // promoting runtime code is only allowed to error if it references broken constants
@@ -682,6 +683,7 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
                             tcx.at(span),
                             "reaching this expression at runtime will panic or abort",
                             tcx.hir().as_local_hir_id(def_id).unwrap(),
+                            Some(err.span),
                         )
                     }
                 // anything else (array lengths, enum initializers, constant patterns) are reported