rustdoc: Remove ResolvedPath.did#91195
Conversation
Before, if `register_res` were called on an associated item or enum variant, it would return the parent's `DefId`. Now, it returns the actual `DefId`. This change is a step toward removing `Type::ResolvedPath.did` and potentially removing `kind_side_channel` in rustdoc. It also just simplifies rustdoc's behavior.
jyn514
left a comment
There was a problem hiding this comment.
I'm not really comfortable approving this ... I like the idea in theory, but it seems very strange that none of the tests broke, and I worry something has broken without us realizing.
I'm not sure if it's very strange; I did update the href code (which IIRC caused lots of tests to fail before I updated it). |
|
📌 Commit 4365112 has been approved by |
|
Oh, it would be nice to fix #91195 (comment) either here or in a follow up though. |
|
And I forgot about #91195 (comment) 🤦 r=me with those two done though @bors r- |
Co-authored-by: Joshua Nelson <github@jyn.dev>
|
@bors r=jyn514 rollup=iffy (to make bisecting easier if necessary) |
|
📌 Commit 617bbb2 has been approved by |
|
⌛ Testing commit 617bbb2 with merge 49b989201328d8a1714cffe31906a0a40ad92044... |
|
💔 Test failed - checks-actions |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@bors retry |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (862962b): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
|
Instructions improvements up to -0.1% and max-rss improvements up to -1% on doc builds :D |
ResolvedPath.didwas not actually the same as.path.def_id(). Instead,.didreferred to theDefIdof the page to be used as a hyperlink target.For example, a link to
Struct::method()would useStruct'sDefIdas its.didfield. This behavior is confusing, easy to accidentally misuse, and caninstead be obtained on-demand when computing hyperlink targets. It's also likely
part of the reason
kind_side_channelexists. I'm currently working on someexperimental refactorings in
collect_intra_doc_linksthat I believe require --or at least benefit from -- removing
.did.r? @jyn514