rustdoc: Populate external_traits with traits only seen in impls#47313
Merged
bors merged 1 commit intorust-lang:masterfrom Jan 18, 2018
Merged
rustdoc: Populate external_traits with traits only seen in impls#47313bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
This means default methods can always be found and "Important traits" will include all spotlight traits.
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
|
||
| pub fn record_extern_trait(cx: &DocContext, did: DefId) { | ||
| cx.external_traits.borrow_mut().entry(did).or_insert_with(|| { | ||
| build_external_trait(cx, did) |
Contributor
There was a problem hiding this comment.
Nice optimization here. 😉
|
|
||
| let traits = &cache().traits; | ||
| let trait_ = i.trait_did().and_then(|did| traits.get(&did)); | ||
| let trait_ = i.trait_did().map(|did| &traits[&did]); |
Contributor
There was a problem hiding this comment.
What's with the change here (and above)? Change the failure mode for missing DefIds?
Contributor
Author
There was a problem hiding this comment.
There now shouldn't be any cases where the trait is missing from the traits map so this change is to make sure it stays like that.
Contributor
|
@bors r+ Thanks! |
Collaborator
|
📌 Commit 45cad04 has been approved by |
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Jan 17, 2018
…, r=QuietMisdreavus rustdoc: Populate external_traits with traits only seen in impls This means default methods can always be found and "Important traits" will include all spotlight traits.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Jan 17, 2018
…, r=QuietMisdreavus rustdoc: Populate external_traits with traits only seen in impls This means default methods can always be found and "Important traits" will include all spotlight traits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This means default methods can always be found and "Important traits" will include all spotlight traits.