about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/eval_context.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-09 06:24:28 +0000
committerbors <bors@rust-lang.org>2022-12-09 06:24:28 +0000
commitbadd6a5a03e87920259e1510e710526b51faadbe (patch)
tree0a50648bc8747cab60037bbd8ca7409250ba54bf /compiler/rustc_const_eval/src/interpret/eval_context.rs
parent7701a7e7d4eed74a106f39fa64899dffd1e1025f (diff)
parent717fdb58176096d5cd01d9d9ebaf01d756f2234b (diff)
downloadrust-badd6a5a03e87920259e1510e710526b51faadbe.tar.gz
rust-badd6a5a03e87920259e1510e710526b51faadbe.zip
Auto merge of #104449 - oli-obk:unhide_unknown_spans, r=estebank,RalfJung
Start emitting labels even if their pointed to file is not available locally

r? `@estebank`

cc `@RalfJung`

fixes #97699
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/eval_context.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/eval_context.rs18
1 files changed, 3 insertions, 15 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs
index e17d3e516a6..0b2809f1d2c 100644
--- a/compiler/rustc_const_eval/src/interpret/eval_context.rs
+++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs
@@ -17,7 +17,7 @@ use rustc_middle::ty::{
 };
 use rustc_mir_dataflow::storage::always_storage_live_locals;
 use rustc_session::Limit;
-use rustc_span::{Pos, Span};
+use rustc_span::Span;
 use rustc_target::abi::{call::FnAbi, Align, HasDataLayout, Size, TargetDataLayout};
 
 use super::{
@@ -256,25 +256,13 @@ impl<'tcx> fmt::Display for FrameInfo<'tcx> {
             if tcx.def_key(self.instance.def_id()).disambiguated_data.data
                 == DefPathData::ClosureExpr
             {
-                write!(f, "inside closure")?;
+                write!(f, "inside closure")
             } else {
                 // Note: this triggers a `good_path_bug` state, which means that if we ever get here
                 // we must emit a diagnostic. We should never display a `FrameInfo` unless we
                 // actually want to emit a warning or error to the user.
-                write!(f, "inside `{}`", self.instance)?;
+                write!(f, "inside `{}`", self.instance)
             }
-            if !self.span.is_dummy() {
-                let sm = tcx.sess.source_map();
-                let lo = sm.lookup_char_pos(self.span.lo());
-                write!(
-                    f,
-                    " at {}:{}:{}",
-                    sm.filename_for_diagnostics(&lo.file.name),
-                    lo.line,
-                    lo.col.to_usize() + 1
-                )?;
-            }
-            Ok(())
         })
     }
 }