-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: links from items in a trait impl are inconsistent #83068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Some changes occurred in HTML/CSS/JS. |
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Looks good to me, thanks! Can you add a test in |
test added 👍 |
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.trait_function"]//a[@class="fnname"]/@href' ../trait_impl_items_links_and_anchors/trait.MyTrait.html#tymethod.trait_function | ||
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function | ||
fn trait_function(&self) {} | ||
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-3"]//a[@class="fnname"]/@href' #method.defaulted_override |
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 lost here: what's the point of testing that this exists on the trait when we're currently on a trait implementation on a type?
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.
this is on the struct impl for the trait on the trait doc page. the method.defaulted_override-3
is targeting the impl, not the trait itself
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.
Apparently not because the href you test is "#method.defaulted_override".
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.
oh right, in the h4
with id method.defaulted_override-3
, there is now the function name (class fnname
that links to it's trait definition, so #method.defaulted_override
, and anchor (class anchor
) that links to itself (the line under this one)
this pr makes it so that every item in a trait impl is that way
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.
That part makes sense, but why are you testing that on the trait page whereas we "are" (so to speak) on the type?
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.
as the type implements the trait, it is present on both page
☔ The latest upstream changes (presumably #82873) made this pull request unmergeable. Please resolve the merge conflicts. |
ping @GuillaumeGomez - this is waiting on your review. @mockersf do you mind fixing the merge conflict in the meantime? |
Still in my review list. :) |
76a49ca
to
7f39530
Compare
This comment has been minimized.
This comment has been minimized.
fixed! |
Thanks! @bors: r+ |
📌 Commit e36ca09 has been approved by |
☀️ Test successful - checks-actions |
Depending on where the struct implementing a trait is coming from, or the current page, the items in a trait impl are not linking to the same thing:
rust code with those cases
In this PR, I fixed all links to target the trait definition, and added an anchor-link to the current implementation appearing on mouse hover.