Skip to content

Conversation

@Urgau
Copy link
Member

@Urgau Urgau commented Dec 19, 2025

Fixes #150100.

This PR fixes a regression introduced by #149709, I was overzealous in my changes (https://github.com/rust-lang/rust/pull/149709/changes#diff-e1cf7ef2fb411d24980cd4cbea1e867cc36029e9496e1ceca64cfb6a0e3510f6) and accidentally changed the behavior of rustdoc in the presence of remapped, to simply reject them instead of handling them.

With this PR remapped paths are handled correctly, in a similar way as it was before.

I added a run-make test to make sure we don't regress it again, a simple rustdoc test in not sufficient as rustdoc is not called on the auxiliary crate. It's not pretty but it works. #150172 (comment)

rustdoc doesn't have any handling for --remap-path-scope, so I used the MACRO scope (it was already used elsewhere.

cf. https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/source.20links.20missing.20for.20nightly.20std.20docs

r? @GuillaumeGomez

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs 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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Dec 19, 2025
@fmease
Copy link
Member

fmease commented Dec 19, 2025

a simple rustdoc test in not sufficient as rustdoc is not called on the auxiliary crate

//@ build-aux-docs enables doc building for auxiliaries.

@rust-log-analyzer

This comment has been minimized.

@Urgau
Copy link
Member Author

Urgau commented Dec 19, 2025

//@ build-aux-docs enables doc building for auxiliaries.

This almost work, except that the compile-flags of the auxiliary crate are also passed to rustdoc, and unfortunately it trips an assertion in rustdoc. EDIT: lol we trip the same assertion in another test.

Nevermind, the fix was incomplete. It works fine now.

Details
thread 'rustc' (52267) panicked at src/librustdoc/html/sources.rs:349:14:
only local crates should have sources emitted

@Urgau Urgau force-pushed the rustdoc-remap-fixes branch from dfdb113 to 811c241 Compare December 19, 2025 22:24
// This is a regression for `--remap-path-prefix` in an auxiliary dependency.
//
// We want to make sure that we can still have the "Source" links to the dependency
// even if it's paths are remapped.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// even if it's paths are remapped.
// even if its paths are remapped.

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 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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add regression test for https://github.com/rust-lang/rust/pull/149919

5 participants