about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-12 07:45:31 +0100
committerGitHub <noreply@github.com>2021-12-12 07:45:31 +0100
commit6d9d8de0290ab4a56772315f958ca6e1d75b6728 (patch)
tree7e373ee1ad282184d355d34b8421e9d06d26d899
parent955e552d31d7a79adc90dc47e4b58fb8b3fb5249 (diff)
parent3de60264ca417977a06ed61b6b97581f6d1a70ee (diff)
downloadrust-6d9d8de0290ab4a56772315f958ca6e1d75b6728.tar.gz
rust-6d9d8de0290ab4a56772315f958ca6e1d75b6728.zip
Rollup merge of #91815 - RalfJung:span, r=oli-obk
better span for unexpected normalization failure in CTFE engine

No reason to use `DUMMY_SP` here.
-rw-r--r--compiler/rustc_const_eval/src/interpret/eval_context.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs
index d46950ed903..a7c08f225b0 100644
--- a/compiler/rustc_const_eval/src/interpret/eval_context.rs
+++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs
@@ -15,7 +15,7 @@ use rustc_middle::ty::{
 use rustc_mir_dataflow::storage::AlwaysLiveLocals;
 use rustc_query_system::ich::StableHashingContext;
 use rustc_session::Limit;
-use rustc_span::{Pos, Span, DUMMY_SP};
+use rustc_span::{Pos, Span};
 use rustc_target::abi::{Align, HasDataLayout, Size, TargetDataLayout};
 
 use super::{
@@ -525,7 +525,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             .try_subst_mir_and_normalize_erasing_regions(*self.tcx, self.param_env, value)
             .or_else(|e| {
                 self.tcx.sess.delay_span_bug(
-                    DUMMY_SP,
+                    self.cur_span(),
                     format!("failed to normalize {}", e.get_type_for_failure()).as_str(),
                 );