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 {
pub fn new(name: String, callee: Span, cx: &LateContext<'_>) -> Self {
let mut path = cx
.sess()
.source_map()
.span_to_filename(callee)
.prefer_local()
let sm = cx.sess().source_map();
let mut path = sm.filename_for_diagnostics(&sm.span_to_filename(callee))
.to_string();
// std lib paths are <::std::module::file type>