-
Notifications
You must be signed in to change notification settings - Fork 13.5k
rustdoc: Remove ResolvedPath.did
#91195
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.did
was not actually the same as.path.def_id()
. Instead,.did
referred to theDefId
of the page to be used as a hyperlink target.For example, a link to
Struct::method()
would useStruct
'sDefId
as its.did
field. 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_channel
exists. I'm currently working on someexperimental refactorings in
collect_intra_doc_links
that I believe require --or at least benefit from -- removing
.did
.r? @jyn514