Skip to content

Output remapped paths in rustdoc JSON with the documentation scope - #164278

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Urgau:rustdoc-json-remap-path
Oct 15, 2026
Merged

rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Urgau:rustdoc-json-remap-path

Conversation

@Urgau

@Urgau Urgau commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

View all comments

Let's make rustdoc-json respect --remap-path-prefix and --remap-path-scope (if passed), by using the documentation scope.

That's a perfect application for the rustdoc-only documentation scope.

r? @GuillaumeGomez

@rustbot

rustbot commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

These commits modify tests/rustdoc-json.
rustdoc-json is a public (but unstable) interface.

Please ensure that if you've changed the output:

  • It's intentional.
  • The FORMAT_VERSION in src/librustdoc-json-types is bumped if necessary.

cc @obi1kenobi

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 13, 2026
@Urgau
Urgau force-pushed the rustdoc-json-remap-path branch from 5b2e639 to 835129f Compare October 13, 2026 18:55
@Urgau Urgau changed the title Output remapped paths in rustdoc JSON with the DOCUMENTATION scope Output remapped paths in rustdoc JSON with the documentation scope Oct 13, 2026
Comment thread tests/rustdoc-json/remap-path-prefix/debuginfo.rs
@Urgau
Urgau force-pushed the rustdoc-json-remap-path branch from 835129f to f8d4856 Compare October 13, 2026 19:50
Comment thread tests/rustdoc-json/README.md Outdated
@Urgau
Urgau force-pushed the rustdoc-json-remap-path branch from 43fbba2 to 1efec5a Compare October 13, 2026 20:09
@Urgau
Urgau force-pushed the rustdoc-json-remap-path branch from 1efec5a to 0d0f404 Compare October 13, 2026 20:12
@GuillaumeGomez

Copy link
Copy Markdown
Member

Thanks!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 0d0f404 has been tentatively approved by GuillaumeGomez

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 13, 2026
@obi1kenobi

obi1kenobi commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Out of curiosity, is this worth bumping the format version, or not? I have no opinion one way or the other, I'm just curious since I'm not sure about the implications of this PR. E.g., whether any behaviors would visibly change to existing consumers, including cargo-semver-checks.

jhpratt added a commit to jhpratt/rust that referenced this pull request Oct 14, 2026
…uillaumeGomez

Output remapped paths in rustdoc JSON with the `documentation` scope

Let's make rustdoc-json respect `--remap-path-prefix` and `--remap-path-scope` (if passed), by using the `documentation` scope.

That's a perfect application for the rustdoc-only `documentation` scope.
@Urgau

Urgau commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Out of curiosity, is this worth bumping the format version, or not?

I don't think so, the format it-self doesn't change. The only thing that changes is the value of span.filename if --remap-path-prefix (with/without --remap-path-scope) is passed to the crate or a dependency of it.

Quickly looking at cargo-semver-checks, I don't see any references to either of them, so I'm not expecting any changes for you.

@Urgau

Urgau commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

One thing may see however is that for the distributed standard library json rust-docs-json the filenames might start be correctly prefixed by /rustc/<RUSTC_SHA>, since we do remap paths for all distributed artifacts, but I haven't verified this.

rust-bors Bot pushed a commit that referenced this pull request Oct 14, 2026
Rollup of 9 pull requests

Successful merges:

 - #162749 (Recover missing `turbofish` for `lifetime` arguments in expression position)
 - #164170 (Prefer WriteConsoleW for stdout on Windows)
 - #164255 (test DSL eagerly handle false constraints)
 - #163230 (Document zero-sized allocations properly for `Box` and `Vec`)
 - #163940 (Parse move exprs as a bottom expr instead of a prefix expr)
 - #164219 (Windows FileExt trait doesn't need to handle ErrorKind::Interrupted; test improvements for same)
 - #164220 (Test the interaction between `--remap-path-prefix` and doctests)
 - #164266 (rustdoc: Improvements for `rustc_must_implement_one_of`)
 - #164278 (Output remapped paths in rustdoc JSON with the `documentation` scope)
@JonathanBrouwer

Copy link
Copy Markdown
Member

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #164296 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 14, 2026
@rust-bors

rust-bors Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#164296), which was unapproved.

View changes since this unapproval

@Urgau

Urgau commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=aarch64,test-various

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 14, 2026
Output remapped paths in rustdoc JSON with the `documentation` scope


try-job: *aarch64*
try-job: test-various
@rust-bors

rust-bors Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: fcb79a4 (fcb79a41500d7e4988b04b580791c81a5769fa46)
Base parent: f6c1107 (f6c1107f8be13e48465e12c0fd26e6a39fe18e4f)

@Urgau
Urgau force-pushed the rustdoc-json-remap-path branch from 4117a5e to 7fec32e Compare October 14, 2026 21:17
@Urgau

Urgau commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=aarch64,test-various

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 14, 2026
Output remapped paths in rustdoc JSON with the `documentation` scope


try-job: *aarch64*
try-job: test-various
@rust-bors

rust-bors Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 14f98a3 (14f98a381c6877de897549302cb91403cd15b7ce)
Base parent: f6c1107 (f6c1107f8be13e48465e12c0fd26e6a39fe18e4f)

@Urgau

Urgau commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

@bors r=GuillaumeGomez

@rust-bors

rust-bors Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7fec32e has been approved by GuillaumeGomez

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 15, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 15, 2026
…uillaumeGomez

Output remapped paths in rustdoc JSON with the `documentation` scope

Let's make rustdoc-json respect `--remap-path-prefix` and `--remap-path-scope` (if passed), by using the `documentation` scope.

That's a perfect application for the rustdoc-only `documentation` scope.
rust-bors Bot pushed a commit that referenced this pull request Oct 15, 2026
Rollup of 7 pull requests

Successful merges:

 - #163132 (Test panics and wasm32-wasip3 in CI, not wasip1)
 - #164076 (Fix ICE when move expressions reference out-of-scope local bindings)
 - #162432 (Improve diagnostics for non-well-formed associated items)
 - #164138 (cg_llvm: Use a callback to enforce scoped lifetimes in ModuleLlvm )
 - #164220 (Test the interaction between `--remap-path-prefix` and doctests)
 - #164225 (Point at assoc item for trait that needs to be implemented)
 - #164278 (Output remapped paths in rustdoc JSON with the `documentation` scope)
rust-bors Bot pushed a commit that referenced this pull request Oct 15, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #163132 (Test panics and wasm32-wasip3 in CI, not wasip1)
 - #164314 (Abby: use a smallvec for `And`/`Or` constraints)
 - #148413 (Mangle personality symbol)
 - #163688 (Add aarch64-unknown-qtee as a tier 3 target)
 - #164076 (Fix ICE when move expressions reference out-of-scope local bindings)
 - #164327 ([coff] Symbol renaming stored the original name, not the undecorated name)
 - #162432 (Improve diagnostics for non-well-formed associated items)
 - #164138 (cg_llvm: Use a callback to enforce scoped lifetimes in ModuleLlvm )
 - #164210 (`incomplete` -> `unstable` for delegation feature)
 - #164225 (Point at assoc item for trait that needs to be implemented)
 - #164278 (Output remapped paths in rustdoc JSON with the `documentation` scope)
 - #164308 (format abby dsl errors better)
 - #164335 (expand and document tool attribute shadowing test)
 - #164342 (Use regular type parsing for argument-position const parameters)
@rust-bors
rust-bors Bot merged commit 68f7a0a into rust-lang:main Oct 15, 2026
15 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 15, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 15, 2026
Rollup merge of #164278 - Urgau:rustdoc-json-remap-path, r=GuillaumeGomez

Output remapped paths in rustdoc JSON with the `documentation` scope

Let's make rustdoc-json respect `--remap-path-prefix` and `--remap-path-scope` (if passed), by using the `documentation` scope.

That's a perfect application for the rustdoc-only `documentation` scope.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 15, 2026
…cope-of-object, r=GuillaumeGomez

Make the `documentation` scope a sub-scope of the `object` scope

~~First commit from rust-lang#164278.~~

This PR moves the `documentation` scope to be a sub-scope of the `object` scope.

The `object` scope is currently defined to be: "This ensures all paths in compiled executables, libraries and objects outputs are remapped but not elsewhere", which can be translated to mean everything written to disk by `rustc` it-self.

It is therefore a natural extension for the `documentation` scope to be a sub-scope of it, like `macro`, `debuginfo` and `coverage`, since we use it for things written down on disk, like rustdoc-json (with rust-lang#164278 at-least) or the source code viewer.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 15, 2026
…cope-of-object, r=GuillaumeGomez

Make the `documentation` scope a sub-scope of the `object` scope

~~First commit from rust-lang#164278.~~

This PR moves the `documentation` scope to be a sub-scope of the `object` scope.

The `object` scope is currently defined to be: "This ensures all paths in compiled executables, libraries and objects outputs are remapped but not elsewhere", which can be translated to mean everything written to disk by `rustc` it-self.

It is therefore a natural extension for the `documentation` scope to be a sub-scope of it, like `macro`, `debuginfo` and `coverage`, since we use it for things written down on disk, like rustdoc-json (with rust-lang#164278 at-least) or the source code viewer.
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (0189fb4): comparison URL.

Overall result: ❌ regressions - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.4% [0.2%, 0.8%] 10
Regressions ❌
(secondary)
0.4% [0.1%, 0.8%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.2%, 0.8%] 10

Max RSS (memory usage)

Results (primary -4.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.1% [-4.1%, -4.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -4.1% [-4.1%, -4.1%] 1

Cycles

Results (secondary -1.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [2.8%, 4.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-7.1% [-11.8%, -2.5%] 2
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Artifact size: 407.05 MiB -> 407.16 MiB (0.03%)

@rustbot rustbot added the perf-regression Performance regression. label Oct 16, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 16, 2026
…cope-of-object, r=GuillaumeGomez

Make the `documentation` scope a sub-scope of the `object` scope

~~First commit from rust-lang#164278.~~

This PR moves the `documentation` scope to be a sub-scope of the `object` scope.

The `object` scope is currently defined to be: "This ensures all paths in compiled executables, libraries and objects outputs are remapped but not elsewhere", which can be translated to mean everything written to disk by `rustc` it-self.

It is therefore a natural extension for the `documentation` scope to be a sub-scope of it, like `macro`, `debuginfo` and `coverage`, since we use it for things written down on disk, like rustdoc-json (with rust-lang#164278 at-least) or the source code viewer.
rust-bors Bot pushed a commit that referenced this pull request Oct 16, 2026
Rollup merge of #164279 - Urgau:documentation-scope-as-sub-scope-of-object, r=GuillaumeGomez

Make the `documentation` scope a sub-scope of the `object` scope

~~First commit from #164278.~~

This PR moves the `documentation` scope to be a sub-scope of the `object` scope.

The `object` scope is currently defined to be: "This ensures all paths in compiled executables, libraries and objects outputs are remapped but not elsewhere", which can be translated to mean everything written to disk by `rustc` it-self.

It is therefore a natural extension for the `documentation` scope to be a sub-scope of it, like `macro`, `debuginfo` and `coverage`, since we use it for things written down on disk, like rustdoc-json (with #164278 at-least) or the source code viewer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-json Area: Rustdoc JSON backend perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants