Skip to content

Commit

Permalink
Path remapping: Make behavior of diagnostics output dependent on pres…
Browse files Browse the repository at this point in the history
…ence of --remap-path-prefix.
  • Loading branch information
michaelwoerister committed Aug 27, 2021
1 parent afd892a commit c6c1f32
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions clippy_lints/src/macro_use.rs
Expand Up @@ -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>
Expand Down

0 comments on commit c6c1f32

Please sign in to comment.