Uh oh!
There was an error while loading. Please reload this page.
Fix "kind" for associated types in trait implementations in rustdoc JSON - #98577
Conversation
514e021 to
9277f95Comparenotriddle
commented
Jun 27, 2022
Am I correct in guessing that this PR is an alternative to #98548 ? |
Yes. EDIT: Ok extra explanations: since we're now generating the correct |
notriddle
commented
Jun 27, 2022
@bors r+ |
bors
commented
Jun 27, 2022
📌 Commit 9277f95 has been approved by |
…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
| }, | ||
| // FIXME: do not map to Typedef but to a custom variant | ||
| AssocTypeItem(t, _) => ItemEnum::Typedef(t.into_tcx(tcx)), | ||
| AssocTypeItem(t, b) => ItemEnum::AssocType { |
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
| 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)), |
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.
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