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 afd892a549
commit c6c1f328eb

View File

@@ -47,11 +47,8 @@ pub struct MacroRefData {
impl MacroRefData { impl MacroRefData {
pub fn new(name: String, callee: Span, cx: &LateContext<'_>) -> Self { pub fn new(name: String, callee: Span, cx: &LateContext<'_>) -> Self {
let mut path = cx let sm = cx.sess().source_map();
.sess() let mut path = sm.filename_for_diagnostics(&sm.span_to_filename(callee))
.source_map()
.span_to_filename(callee)
.prefer_local()
.to_string(); .to_string();
// std lib paths are <::std::module::file type> // std lib paths are <::std::module::file type>