1
Fork 0

Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix.

This commit is contained in:
Michael Woerister 2021-08-26 12:46:01 +02:00
parent dfd6306d26
commit af1b65cb18
13 changed files with 65 additions and 41 deletions

View file

@ -272,11 +272,12 @@ impl<'tcx> fmt::Display for FrameInfo<'tcx> {
write!(f, "inside `{}`", self.instance)?;
}
if !self.span.is_dummy() {
let lo = tcx.sess.source_map().lookup_char_pos(self.span.lo());
let sm = tcx.sess.source_map();
let lo = sm.lookup_char_pos(self.span.lo());
write!(
f,
" at {}:{}:{}",
lo.file.name.prefer_local(),
sm.filename_for_diagnostics(&lo.file.name),
lo.line,
lo.col.to_usize() + 1
)?;