Add paths for linked associated items#156474
Conversation
|
These commits modify Please ensure that if you've changed the output:
|
|
rustbot has assigned @lolbinarycat. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| paths | ||
| } | ||
|
|
||
| #[allow(rustc::potential_query_instability)] |
There was a problem hiding this comment.
NIT: Could this attribute be more tightly scoped on the call causing the instability.
There was a problem hiding this comment.
It's still not clear (to me) which call is causing the instability here.
There was a problem hiding this comment.
This is the diag without it:
warning: using `values` can result in unstable query results
--> src/librustdoc/json/mod.rs:137:48
|
137 | let links = self.cache.intra_doc_links.values();
| ^^^^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
note: the lint level is defined here
--> src/librustdoc/lib.rs:18:9
|
18 | #![warn(rustc::internal)]
| ^^^^^^^^^^^^^^^
= note: `#[warn(rustc::potential_query_instability)]` implied by `#[warn(rustc::internal)]`
| //@ is "$.index[?(@.name=='non_page')].links['`Trait::method`']" $method | ||
|
|
||
| // Regression test for <https://github.com/rust-lang/rust/issues/152511>: | ||
| // link target IDs for associated items need matching `paths` entries. |
There was a problem hiding this comment.
I'd really like this to test that the ID's are also correct, but I think that would need something like #142479 to be able to express.
There was a problem hiding this comment.
I think so, this implementation is hairy enough that I don't think it should be merged without more robust tests, to provide assurance of present and ongoing correctness.
There was a problem hiding this comment.
The IDs are still not tested, right?
There was a problem hiding this comment.
Yes, unless @aDotInTheVoid says otherwise.
There was a problem hiding this comment.
#142479 was merged, allowing to test IDs (which is the blocker for this PR). So what's blocking you?
There was a problem hiding this comment.
Testing with the IDs which i landed in c78d0a7
There was a problem hiding this comment.
Ah I see. Then looks good to me.
This comment has been minimized.
This comment has been minimized.
a6a1fe3 to
3003031
Compare
This comment has been minimized.
This comment has been minimized.
|
Blocked on #142479 (see #156474 (comment)) @rustbot blocked I can no longer approve this (rust-lang/team#2523) r? rustdoc-json-backend |
3003031 to
c78d0a7
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
@aDotInTheVoid I believe we're good to go with c78d0a7 |
|
@bors r=aDotInTheVoid,GuillaumeGomez rollup |
|
📋 This PR cannot be approved because it currently has the following label: |
|
Interesting, didn't know about this feature. @bors r=aDotInTheVoid,GuillaumeGomez rollup |
…r=aDotInTheVoid,GuillaumeGomez Add paths for linked associated items rustdoc-json emits intra-doc links to associated items using the associated item's id. For external associated items, that id is not present in `index`, and it was also missing from `paths`. This PR backfills missing `paths` summaries for intra-doc link targets from the resolved page item and cached parent paths. Local targets are only added when already present in `index`, preserving jsondoclint's local-path invariant. Fixes rust-lang#152511
…r=aDotInTheVoid,GuillaumeGomez Add paths for linked associated items rustdoc-json emits intra-doc links to associated items using the associated item's id. For external associated items, that id is not present in `index`, and it was also missing from `paths`. This PR backfills missing `paths` summaries for intra-doc link targets from the resolved page item and cached parent paths. Local targets are only added when already present in `index`, preserving jsondoclint's local-path invariant. Fixes rust-lang#152511
…r=aDotInTheVoid,GuillaumeGomez Add paths for linked associated items rustdoc-json emits intra-doc links to associated items using the associated item's id. For external associated items, that id is not present in `index`, and it was also missing from `paths`. This PR backfills missing `paths` summaries for intra-doc link targets from the resolved page item and cached parent paths. Local targets are only added when already present in `index`, preserving jsondoclint's local-path invariant. Fixes rust-lang#152511
Rollup of 12 pull requests Successful merges: - #159582 (Sync from portable simd 2026 07 20) - #158890 (Fix splat v0 mangling) - #159411 ([rustdoc] Correctly handle output options with --show-coverage) - #159647 (Remove `early_exit` closures) - #159656 (define a `Simd` type in `minicore`) - #156474 (Add paths for linked associated items) - #159211 (Fix debuginfo argument when invoking LLBC linker) - #159527 (Bring runtime symbols statics on par with foreign functions) - #159625 (Refactor is_opsem_inhabited) - #159652 (Remove `cfg(not(no_global_oom_handling))` from the `Drop` impl of `UniqueArcUninit`) - #159657 (Remove the blanket `#![cfg_attr(test, allow(unused))]` from bootstrap ) - #159663 (Add layout cycle hang regression test)
…r=aDotInTheVoid,GuillaumeGomez Add paths for linked associated items rustdoc-json emits intra-doc links to associated items using the associated item's id. For external associated items, that id is not present in `index`, and it was also missing from `paths`. This PR backfills missing `paths` summaries for intra-doc link targets from the resolved page item and cached parent paths. Local targets are only added when already present in `index`, preserving jsondoclint's local-path invariant. Fixes rust-lang#152511
Rollup of 13 pull requests Successful merges: - #159582 (Sync from portable simd 2026 07 20) - #158890 (Fix splat v0 mangling) - #159614 (debuginfo generation for unsafe binders) - #159647 (Remove `early_exit` closures) - #159656 (define a `Simd` type in `minicore`) - #156474 (Add paths for linked associated items) - #159211 (Fix debuginfo argument when invoking LLBC linker) - #159527 (Bring runtime symbols statics on par with foreign functions) - #159625 (Refactor is_opsem_inhabited) - #159629 (Add more splat rust-call regression tests) - #159652 (Remove `cfg(not(no_global_oom_handling))` from the `Drop` impl of `UniqueArcUninit`) - #159657 (Remove the blanket `#![cfg_attr(test, allow(unused))]` from bootstrap ) - #159663 (Add layout cycle hang regression test)
Rollup of 13 pull requests Successful merges: - #159582 (Sync from portable simd 2026 07 20) - #158890 (Fix splat v0 mangling) - #159614 (debuginfo generation for unsafe binders) - #159647 (Remove `early_exit` closures) - #159656 (define a `Simd` type in `minicore`) - #156474 (Add paths for linked associated items) - #159211 (Fix debuginfo argument when invoking LLBC linker) - #159527 (Bring runtime symbols statics on par with foreign functions) - #159625 (Refactor is_opsem_inhabited) - #159629 (Add more splat rust-call regression tests) - #159652 (Remove `cfg(not(no_global_oom_handling))` from the `Drop` impl of `UniqueArcUninit`) - #159657 (Remove the blanket `#![cfg_attr(test, allow(unused))]` from bootstrap ) - #159663 (Add layout cycle hang regression test)
Rollup merge of #156474 - qaijuang:rustdoc-json-link-paths, r=aDotInTheVoid,GuillaumeGomez Add paths for linked associated items rustdoc-json emits intra-doc links to associated items using the associated item's id. For external associated items, that id is not present in `index`, and it was also missing from `paths`. This PR backfills missing `paths` summaries for intra-doc link targets from the resolved page item and cached parent paths. Local targets are only added when already present in `index`, preserving jsondoclint's local-path invariant. Fixes #152511
Rollup of 13 pull requests Successful merges: - rust-lang/rust#159582 (Sync from portable simd 2026 07 20) - rust-lang/rust#158890 (Fix splat v0 mangling) - rust-lang/rust#159614 (debuginfo generation for unsafe binders) - rust-lang/rust#159647 (Remove `early_exit` closures) - rust-lang/rust#159656 (define a `Simd` type in `minicore`) - rust-lang/rust#156474 (Add paths for linked associated items) - rust-lang/rust#159211 (Fix debuginfo argument when invoking LLBC linker) - rust-lang/rust#159527 (Bring runtime symbols statics on par with foreign functions) - rust-lang/rust#159625 (Refactor is_opsem_inhabited) - rust-lang/rust#159629 (Add more splat rust-call regression tests) - rust-lang/rust#159652 (Remove `cfg(not(no_global_oom_handling))` from the `Drop` impl of `UniqueArcUninit`) - rust-lang/rust#159657 (Remove the blanket `#![cfg_attr(test, allow(unused))]` from bootstrap ) - rust-lang/rust#159663 (Add layout cycle hang regression test)
View all comments
rustdoc-json emits intra-doc links to associated items using the associated item's id. For external associated items, that id is not present in
index, and it was also missing frompaths.This PR backfills missing
pathssummaries for intra-doc link targets from the resolved page item and cached parent paths. Local targets are only added when already present inindex, preserving jsondoclint's local-path invariant.Fixes #152511