Skip to content

Commit c6c1f32

Browse files
Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix.
1 parent afd892a commit c6c1f32

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clippy_lints/src/macro_use.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ pub struct MacroRefData {
4747

4848
impl MacroRefData {
4949
pub fn new(name: String, callee: Span, cx: &LateContext<'_>) -> Self {
50-
let mut path = cx
51-
.sess()
52-
.source_map()
53-
.span_to_filename(callee)
54-
.prefer_local()
50+
let sm = cx.sess().source_map();
51+
let mut path = sm.filename_for_diagnostics(&sm.span_to_filename(callee))
5552
.to_string();
5653

5754
// std lib paths are <::std::module::file type>

0 commit comments

Comments
 (0)