From 432a29bdde97b8ffd662028fa7056d9b501c0ccd Mon Sep 17 00:00:00 2001 From: Urgau Date: Tue, 13 Oct 2026 21:12:21 +0200 Subject: [PATCH 1/2] Make the `documentation` scope a sub-scope of the `object` scope --- compiler/rustc_span/src/lib.rs | 6 +++--- tests/run-make/remap-path-prefix/rmake.rs | 2 +- tests/rustdoc-json/remap-path-prefix/object.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index f048fb04af45a..f69efebf5c950 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -250,9 +250,9 @@ bitflags::bitflags! { /// Apply remappings to documentation information const DOCUMENTATION = 1 << 5; - /// An alias for `macro`, `debuginfo` and `coverage`. This ensures all paths in compiled - /// executables, libraries and objects are remapped but not elsewhere. - const OBJECT = Self::MACRO.bits() | Self::DEBUGINFO.bits() | Self::COVERAGE.bits(); + /// An alias for `macro`, `documentation`, `debuginfo` and `coverage`. This ensures all paths in compiled + /// executables, libraries, objects and documentation outputs are remapped but not elsewhere. + const OBJECT = Self::MACRO.bits() | Self::DOCUMENTATION.bits() | Self::DEBUGINFO.bits() | Self::COVERAGE.bits(); } } diff --git a/tests/run-make/remap-path-prefix/rmake.rs b/tests/run-make/remap-path-prefix/rmake.rs index 3b866476e9501..0e4d002e2441c 100644 --- a/tests/run-make/remap-path-prefix/rmake.rs +++ b/tests/run-make/remap-path-prefix/rmake.rs @@ -76,7 +76,7 @@ fn main() { rmeta_contains("auxiliary"); out_diagobj.run(); rmeta_contains("/the/aux/lib.rs"); - rmeta_contains("auxiliary"); + rmeta_not_contains("auxiliary"); out_diagdocobj.run(); rmeta_contains("/the/aux/lib.rs"); rmeta_not_contains("auxiliary"); diff --git a/tests/rustdoc-json/remap-path-prefix/object.rs b/tests/rustdoc-json/remap-path-prefix/object.rs index 052ad7651eeab..00df241249317 100644 --- a/tests/rustdoc-json/remap-path-prefix/object.rs +++ b/tests/rustdoc-json/remap-path-prefix/object.rs @@ -1,5 +1,5 @@ //@ compile-flags: --remap-path-prefix={{src-base}}=/remapped //@ compile-flags: --remap-path-scope=object -Zunstable-options -//@ is "$.index[?(@.name=='StrLike')].span.filename" $FILE +//@ is "$.index[?(@.name=='StrLike')].span.filename" \"/remapped/remap-path-prefix/object.rs\" pub trait StrLike {} From a48e9046a28554c838127a0c726c4c2639fa499a Mon Sep 17 00:00:00 2001 From: Urgau <3616612+Urgau@users.noreply.github.com> Date: Fri, 16 Oct 2026 07:43:27 +0200 Subject: [PATCH 2/2] Add missing ignore-windows due to path sep differences --- tests/rustdoc-json/remap-path-prefix/object.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/rustdoc-json/remap-path-prefix/object.rs b/tests/rustdoc-json/remap-path-prefix/object.rs index 00df241249317..18d869580883a 100644 --- a/tests/rustdoc-json/remap-path-prefix/object.rs +++ b/tests/rustdoc-json/remap-path-prefix/object.rs @@ -1,3 +1,4 @@ +//@ ignore-windows //@ compile-flags: --remap-path-prefix={{src-base}}=/remapped //@ compile-flags: --remap-path-scope=object -Zunstable-options