about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-08-23 15:46:58 +0200
committerUrgau <urgau@numericable.fr>2023-10-17 10:11:30 +0200
commiteccc9e66287d5fd141e458ae3ab25ac96a567972 (patch)
tree3a25d640e092a65712b8d42c1ce2a8f8cdf959f5 /compiler/rustc_codegen_ssa/src
parent30f94717ca69f799873698e147ac03ffc0a6fa56 (diff)
downloadrust-eccc9e66287d5fd141e458ae3ab25ac96a567972.tar.gz
rust-eccc9e66287d5fd141e458ae3ab25ac96a567972.zip
[RFC 3127 - Trim Paths]: Condition remapped filepath on remap scopes
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/block.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs
index 60620f26bbb..68f22aaf990 100644
--- a/compiler/rustc_codegen_ssa/src/mir/block.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs
@@ -1454,10 +1454,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         let tcx = bx.tcx();
 
         let mut span_to_caller_location = |span: Span| {
+            use rustc_session::RemapFileNameExt;
             let topmost = span.ctxt().outer_expn().expansion_cause().unwrap_or(span);
             let caller = tcx.sess.source_map().lookup_char_pos(topmost.lo());
             let const_loc = tcx.const_caller_location((
-                Symbol::intern(&caller.file.name.prefer_remapped().to_string_lossy()),
+                Symbol::intern(&caller.file.name.for_codegen(self.cx.sess()).to_string_lossy()),
                 caller.line as u32,
                 caller.col_display as u32 + 1,
             ));