diff options
| author | Andy Wang <cbeuw.andy@gmail.com> | 2021-04-19 23:27:02 +0100 |
|---|---|---|
| committer | Andy Wang <cbeuw.andy@gmail.com> | 2021-05-05 15:31:28 +0100 |
| commit | e162eeb1f0492822cc810decee23d6d9b9c084f0 (patch) | |
| tree | c18adc593361a5f8ae5bff9cebb255b9724e753f | |
| parent | 5de83e7bd1929d6e18c19dc4430bdcececc905c2 (diff) | |
| download | rust-e162eeb1f0492822cc810decee23d6d9b9c084f0.tar.gz rust-e162eeb1f0492822cc810decee23d6d9b9c084f0.zip | |
Use local and remapped paths where appropriate
| -rw-r--r-- | src/common.rs | 4 | ||||
| -rw-r--r-- | src/debuginfo/line_info.rs | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/common.rs b/src/common.rs index 92e4435565e..c12d6d0f141 100644 --- a/src/common.rs +++ b/src/common.rs @@ -334,7 +334,9 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> { let topmost = span.ctxt().outer_expn().expansion_cause().unwrap_or(span); let caller = self.tcx.sess.source_map().lookup_char_pos(topmost.lo()); let const_loc = self.tcx.const_caller_location(( - rustc_span::symbol::Symbol::intern(&caller.file.name.to_string()), + rustc_span::symbol::Symbol::intern( + &caller.file.name.prefer_remapped().to_string_lossy(), + ), caller.line as u32, caller.col_display as u32 + 1, )); diff --git a/src/debuginfo/line_info.rs b/src/debuginfo/line_info.rs index b3f700bc467..9eb06770630 100644 --- a/src/debuginfo/line_info.rs +++ b/src/debuginfo/line_info.rs @@ -87,7 +87,7 @@ fn line_program_add_file( filename => { let dir_id = line_program.default_directory(); let dummy_file_name = LineString::new( - filename.to_string().into_bytes(), + filename.prefer_remapped().to_string().into_bytes(), line_program.encoding(), line_strings, ); |
