Skip to content
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

Merged
merged 1 commit into from May 15, 2020
Merged

Make intra links work inside trait impl block #72173

merged 1 commit into from May 15, 2020

Conversation

ghost
Copy link

@ghost ghost commented May 13, 2020

Closes #54172

.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;
Copy link
Member

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);
    });

?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done.

@GuillaumeGomez
Copy link
Member

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

@ghost
Copy link
Author

ghost commented May 13, 2020

@rust-lang/rustdoc are we merging ;)

@ghost ghost mentioned this pull request May 14, 2020
@GuillaumeGomez
Copy link
Member

Moving forward then.

@bors: r+

@bors
Copy link
Contributor

bors commented May 14, 2020

📌 Commit 617c7cd has been approved by GuillaumeGomez

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 14, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request May 15, 2020
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
@bors bors merged commit da0745a into rust-lang:master May 15, 2020
@ghost ghost mentioned this pull request May 15, 2020
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc cannot resolve specific trait impl functions
3 participants