-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make intra links work inside trait impl block #72173
Conversation
.find(|item| item.ident.name == item_name); | ||
// We need item's parent to know if it's | ||
// trait impl or struct/enum/etc impl | ||
let mut item_parent = None; |
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.
Why not:
let mut item_parent = item_opt
.and_then(|item| self.cx.as_local_hir_id(item.def_id))
.and_then(|item_hir| {
let parent_hir = self.cx.tcx.hir().get_parent_item(item_hir);
cx.tcx.hir().find(parent_hir);
});
?
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.
Thanks, done.
Thanks for the PR! Looks good globally, just a little code improvement to be done and it's good for me! cc @rust-lang/rustdoc |
@rust-lang/rustdoc are we merging ;) |
Moving forward then. @bors: r+ |
📌 Commit 617c7cd has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#71809 (Use `LocalDefId` in `DumpVisitor::nest_tables`) - rust-lang#72062 (Add built in PSP target) - rust-lang#72146 (Provide separate option for std debug asserts) - rust-lang#72172 (Forbid stage arguments to check) - rust-lang#72173 (Make intra links work inside trait impl block) - rust-lang#72200 (Add prioritize_on attribute to triagebot) - rust-lang#72214 (Minor fixes to comments) Failed merges: r? @ghost
Closes #54172