From dcde31ad1e9af2a73592320af6c32d016a38aa26 Mon Sep 17 00:00:00 2001 From: Urgau Date: Wed, 23 Aug 2023 17:58:21 +0200 Subject: [PATCH] [RFC 3127 - Trim Paths]: Fix building tools (rustdoc, clippy, ...) --- src/librustdoc/html/sources.rs | 3 ++- .../src/utils/internal_lints/metadata_collector.rs | 2 +- src/tools/miri/src/shims/backtrace.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs index 4a218b9b37c..d01553b8e71 100644 --- a/src/librustdoc/html/sources.rs +++ b/src/librustdoc/html/sources.rs @@ -225,7 +225,8 @@ fn emit_source( cur.push(&fname); let title = format!("{} - source", src_fname.to_string_lossy()); - let desc = format!("Source of the Rust file `{}`.", filename.prefer_remapped()); + let desc = + format!("Source of the Rust file `{}`.", filename.prefer_remapped_unconditionaly()); let page = layout::Page { title: &title, css_class: "src", diff --git a/src/tools/clippy/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/src/tools/clippy/clippy_lints/src/utils/internal_lints/metadata_collector.rs index c38a3e81b0f..c8600badf18 100644 --- a/src/tools/clippy/clippy_lints/src/utils/internal_lints/metadata_collector.rs +++ b/src/tools/clippy/clippy_lints/src/utils/internal_lints/metadata_collector.rs @@ -494,7 +494,7 @@ fn from_span(cx: &LateContext<'_>, span: Span) -> Self { 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, } } diff --git a/src/tools/miri/src/shims/backtrace.rs b/src/tools/miri/src/shims/backtrace.rs index ee2edd462d1..08b26f5fe85 100644 --- a/src/tools/miri/src/shims/backtrace.rs +++ b/src/tools/miri/src/shims/backtrace.rs @@ -135,7 +135,7 @@ fn resolve_frame_pointer( 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)) }