Skip to content

Conversation

@matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Nov 21, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

aDotInTheVoid and others added 7 commits November 19, 2025 19:36
This is useful for allowing writing run-make tests that test
rustdoc-json.
- Basically a copy of write_vectored [0]
- Tested on QEMU ovmf.

[0]: rust-lang#146301

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
…esolution

Historically, it's not been possible to robustly resolve a cross-crate
item in rustdoc-json. If you had a `Id` that wasn't in `Crate::index`
(because it was defined in a different crate), you could only look it up
it `Crate::paths`. But there, you don't get the full information, only
an `ItemSummary`. This tells you the `path` and the `crate_id`.

But knowing the `crate_id` isn't enough to be able to build/find the
rustdoc-json output with this item. It's only use is to get a
`ExternalCrate` (via `Crate::external_crates`). But that only tells you
the `name` (as a string). This isn't enough to uniquely identify a
crate, as there could be multiple versions/features [1] [2].

This was originally proposed to be solved via LukeMathWalker's
`--orchestrator-id` proposal
(https://www.github.com/rust-lang/compiler-team/issues/635). But that
requires invasive changes to cargo/rustc. This PR instead implements
Urgau's proposal to re-use the path to a crate's rmeta/rlib as a unique
identifer. Callers can use that to determine which package it
corresponds to in the language of the build-system above rustc. E.g. for
cargo, `cargo rustdoc --message-format=json --output-format=json
-Zunstable-options`).

(Once you've found the right external crate's rustdoc-json output, you
still need to resolve the path->id in that crate. But that's """just"""
a matter of walking the module tree. We should probably still make that
nicer (by, for example, allowing sharing `Id`s between rustdoc-json
document), but that's a future concern)

For some notes from RustWeek 2025, where this was designed, see
https://hackmd.io/0jkdguobTnW7nXoGKAxfEQ

[1]: https://www.github.com/rust-lang/compiler-team/issues/635#issue-1714254865 § Problem
[2]: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Identifying.20external.20crates.20in.20Rustdoc.20JSON/with/352701211
…-out-of-spite-does-it-matter, r=GuillaumeGomez

 rustdoc-json: add rlib path to ExternalCrate to enable robust crate resolution

Historically, it's not been possible to robustly resolve a cross-crate item in rustdoc-json. If you had a `Id` that wasn't in `Crate::index` (because it was defined in a different crate), you could only look it up it `Crate::paths`. But there, you don't get the full information, only an `ItemSummary`. This tells you the `path` and the `crate_id`.

But knowing the `crate_id` isn't enough to be able to build/find the rustdoc-json output with this item. It's only use is to get a `ExternalCrate` (via `Crate::external_crates`). But that only tells you the `name` (as a string). This isn't enough to uniquely identify a crate, as there could be multiple versions/features [^1] [^2].

This was originally proposed to be solved via `@LukeMathWalker's` `--orchestrator-id` proposal (rust-lang/compiler-team#635). But that requires invasive changes to cargo/rustc. This PR instead implements `@Urgau's` proposal to re-use the path to a crate's rmeta/rlib as a unique identifer. Callers can use that to determine which package it corresponds to in the language of the build-system above rustc. E.g. for cargo, `cargo rustdoc --message-format=json --output-format=json -Zunstable-options`).

(Once you've found the right external crate's rustdoc-json output, you still need to resolve the path->id in that crate. But that's """just""" a matter of walking the module tree. We should probably still make that nicer (by, for example, allowing sharing `Id`s between rustdoc-json document), but that's a future concern)

For some notes from RustWeek 2025, where this was designed, see https://hackmd.io/0jkdguobTnW7nXoGKAxfEQ

CC `@obi1kenobi` (who wants this for cargo-semver-checks [^3]), `@epage` (who's conversations on what and wasn't possible with cargo informed taking this approach to solve this problem)

r? `@GuillaumeGomez`

## TODO:

- [x] Docs: [Done](https://github.com/rust-lang/rust/compare/e4cdd0c24a994fed354081b5f907680a11f2ddc5..457ed4edb184997d5d6f879c6a220bc4d69ff6fd)
- [x] Tests: [Done](https://github.com/rust-lang/rust/compare/2e1b954dc52bf7e5a6e9311394df760db37d383f..4d00c1a7ee5e03d1e78801cc01a85dac08ab603b)

[^1]: rust-lang/compiler-team#635 (comment) § Problem
[^2]: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Identifying.20external.20crates.20in.20Rustdoc.20JSON/with/352701211
[^3]: obi1kenobi/cargo-semver-checks#638
std: sys: net: uefi: Implement read_vectored

- Basically a copy of write_vectored [0]
- Tested on QEMU ovmf.

[0]: rust-lang#146301
…pe, r=scottmcm

Constify `residual_into_try_type`

Feature: `const_try_residual` (related to `try_trait_v2_residual`)
Tracking issue: rust-lang#91285

Constify `residual_into_try_type` introduced in rust-lang#148725.

r? `@scottmcm`
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 21, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Nov 21, 2025

📌 Commit ea8ca21 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors 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 Nov 21, 2025
bors added a commit that referenced this pull request Nov 21, 2025
Rollup of 3 pull requests

Successful merges:

 - #149043 ( rustdoc-json: add rlib path to ExternalCrate to enable robust crate resolution)
 - #149134 (std: sys: net: uefi: Implement read_vectored)
 - #149135 (Constify `residual_into_try_type`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Nov 21, 2025

⌛ Testing commit ea8ca21 with merge 5323cbc...

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-msvc-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests\run-make\rustdoc-json-external-crate-path stdout ----

error: rmake recipe failed to complete
status: exit code: 101
command: "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\test\\run-make\\rustdoc-json-external-crate-path\\rmake.exe"
stdout: none
--- stderr -------------------------------

thread 'main' (9876) panicked at C:\a\rust\rust\tests\run-make\rustdoc-json-external-crate-path\rmake.rs:79:5:
assertion `left == right` failed
  left: "\\\\?\\C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\test\\run-make\\rustdoc-json-external-crate-path\\rmake_out\\libdep.rlib"
 right: "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\test\\run-make\\rustdoc-json-external-crate-path\\rmake_out\\libdep.rlib"
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
------------------------------------------

---- [run-make] tests\run-make\rustdoc-json-external-crate-path stdout end ----
---

Some tests failed in compiletest suite=run-make mode=run-make host=aarch64-pc-windows-msvc target=aarch64-pc-windows-msvc
Bootstrap failed while executing `test --stage 2 --skip=compiler --skip=src`
Build completed unsuccessfully in 1:51:18
make: *** [Makefile:112: ci-msvc-py] Error 1
  local time: Fri Nov 21 03:38:03 CUT 2025
  network time: Fri, 21 Nov 2025 03:38:03 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

@bors
Copy link
Collaborator

bors commented Nov 21, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 21, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. 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.

7 participants