Auto merge of #115214 - Urgau:rfc-3127-trim-paths, r=compiler-errors

Implement rustc part of RFC 3127 trim-paths

This PR implements (or at least tries to) [RFC 3127 trim-paths](https://github.com/rust-lang/rust/issues/111540), the rustc part. That is `-Zremap-path-scope` with all of it's components/scopes.

`@rustbot` label: +F-trim-paths
This commit is contained in:
bors 2023-10-19 19:09:29 +00:00
commit 94c4e5c411
34 changed files with 580 additions and 92 deletions

View file

@ -494,7 +494,7 @@ impl SerializableSpan {
let loc: Loc = cx.sess().source_map().lookup_char_pos(span.lo());
Self {
path: format!("{}", loc.file.name.prefer_remapped()),
path: format!("{}", loc.file.name.prefer_remapped_unconditionaly()),
line: loc.line,
}
}

View file

@ -135,7 +135,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
this.tcx.sess.source_map().lookup_char_pos(BytePos(offset.bytes().try_into().unwrap()));
let name = fn_instance.to_string();
let filename = lo.file.name.prefer_remapped().to_string();
let filename = lo.file.name.prefer_remapped_unconditionaly().to_string();
Ok((fn_instance, lo, name, filename))
}