summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2021-12-11 18:55:58 -0500
committerRalf Jung <post@ralfj.de>2021-12-11 18:55:58 -0500
commit3de60264ca417977a06ed61b6b97581f6d1a70ee (patch)
tree7b9d917337a5e819362d78558861c92b50422bf4 /compiler/rustc_const_eval/src
parent928783de663bd855a96f14b2d38c1061603587c6 (diff)
downloadrust-3de60264ca417977a06ed61b6b97581f6d1a70ee.tar.gz
rust-3de60264ca417977a06ed61b6b97581f6d1a70ee.zip
better span for unexpected normalization failure in CTFE engine
Diffstat (limited to 'compiler/rustc_const_eval/src')
-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(),
                 );