Skip to content

Conversation

nnethercote
Copy link
Contributor

We have size checks like these for many different parts of the compiler: AST, HIR, MIR, etc. Those ones all use static_assert_size! from rustc_index, but because rustdoc-json-types is distributed as its own crate it can't depend on rustc_index. So I've just put the checks in a unit test.

Note that Item is currently very large! Making the sizes of these things explicit and tested is the first step towards making them smaller.

r? @aDotInTheVoid

We have size checks like these for many different parts of the compiler:
AST, HIR, MIR, etc. Those ones all use `static_assert_size!` from
`rustc_index`, but because rustdoc-json-types is distributed as its own
crate it can't depend on `rustc_index`. So I've just put the checks in a
unit test.

Note that `Item` is currently very large! Making the sizes of these
things explicit and tested is the first step towards making them
smaller.
@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2025

aDotInTheVoid is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2025

rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing src/librustdoc/json/conversions.rs; otherwise, make sure you bump the FORMAT_VERSION constant.

cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi

@nnethercote
Copy link
Contributor Author

Wait, sorry, I already did this a better way (static assertions) in #142502.

@nnethercote nnethercote closed this Sep 7, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 7, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants