Fix "kind" for associated types in trait implementations in rustdoc JSON#98577
Merged
bors merged 2 commits intorust-lang:masterfrom Jun 28, 2022
Merged
Fix "kind" for associated types in trait implementations in rustdoc JSON#98577bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
514e021 to
9277f95
Compare
Contributor
|
Am I correct in guessing that this PR is an alternative to #98548 ? |
Member
Author
|
Yes. EDIT: Ok extra explanations: since we're now generating the correct |
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit 9277f95 has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 27, 2022
…askrgr Rollup of 9 pull requests Successful merges: - rust-lang#98331 (Fix rustdoc argument error) - rust-lang#98506 (Fix span issues in object safety suggestions) - rust-lang#98563 (interpret: refactor allocation info query) - rust-lang#98576 (small regions refactoring) - rust-lang#98577 (Fix "kind" for associated types in trait implementations in rustdoc JSON) - rust-lang#98578 (Remove eddyb from miri failure pings) - rust-lang#98579 (liballoc tests: avoid int2ptr cast) - rust-lang#98581 (Add triagebot mentions.) - rust-lang#98587 (libcore tests: avoid int2ptr casts) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Enselic
reviewed
Jun 29, 2022
| }, | ||
| // FIXME: do not map to Typedef but to a custom variant | ||
| AssocTypeItem(t, _) => ItemEnum::Typedef(t.into_tcx(tcx)), | ||
| AssocTypeItem(t, b) => ItemEnum::AssocType { |
Member
There was a problem hiding this comment.
My nightly regression test job for cargo public-api found a regression with this change (job)
Reported as #98658
Enselic
reviewed
Jun 29, 2022
| AssocTypeItem(t, b) => ItemEnum::AssocType { | ||
| generics: t.generics.into_tcx(tcx), | ||
| bounds: b.into_iter().map(|x| x.into_tcx(tcx)).collect(), | ||
| default: t.item_type.map(|ty| ty.into_tcx(tcx)), |
Member
There was a problem hiding this comment.
Comparing with the HTML rendering code I think this line should be something like
default: t.item_type.unwrap_or(t.type_).map(|ty| ty.into_tcx(tcx))
I will maybe have time later today to try that fix.
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.
Fixes #81340.
Contrary to what is suggested in the issue, I really think we should distinguish between associated items and "normal" constants and types.
cc @CraftSpider @SimonSapin
r? @notriddle