Skip to content

rustdoc-json: Make Stability compatible with non-self-describing serde formats - #160032

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
aDotInTheVoid:push-svrwoqqpoxsu
Jul 29, 2026
Merged

rustdoc-json: Make Stability compatible with non-self-describing serde formats#160032
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
aDotInTheVoid:push-svrwoqqpoxsu

Conversation

@aDotInTheVoid

Copy link
Copy Markdown
Member

Using #[serde(flatten)] and #[serde(tag = " break using rustdoc-json-types with serde serializers like postcard. rustdoc-json-types should work with these, even if rustdoc itself doesn't use this yet.

This is a breaking change to the FORMAT_VERSION even though rust reader/writer code is uneffected.

cc @obi1kenobi
r? @GuillaumeGomez

@rustbot

rustbot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

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, @Enselic, @obi1kenobi

These commits modify tests/rustdoc-json.
rustdoc-json is a public (but unstable) interface.

Please ensure that if you've changed the output:

  • It's intentional.
  • The FORMAT_VERSION in src/librustdoc-json-types is bumped if necessary.

cc @obi1kenobi

@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 Jul 28, 2026
@rust-log-analyzer

This comment has been minimized.

…rde formats

Using `#[serde(flatten)]` and `#[serde(tag = "` break using rustdoc-json-types
with serde serializers like postcard. rustdoc-json-types should work with
these, even if rustdoc itself doesn't use this yet.

This is a breaking change to the `FORMAT_VERSION` even though rust
reader/writer code is uneffected.
@rust-cloud-vms
rust-cloud-vms Bot force-pushed the push-svrwoqqpoxsu branch from d553cbe to d1da7c5 Compare July 28, 2026 00:48
@GuillaumeGomez

Copy link
Copy Markdown
Member

Do you have a unit test that could show what this new code allows which couldn't be done before?

@aDotInTheVoid

Copy link
Copy Markdown
Member Author

Do you have a unit test that could show what this new code allows which couldn't be done before?

The test_stability test added does this. With just that test (and without the rest of this PR) it fails with:

---- tests::test_stability stdout ----

thread 'tests::test_stability' (1931598) panicked at src/rustdoc-json-types/tests.rs:15:37:
should be able to serialize to postcard: SerializeSeqLengthUnknown
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- tests::test_stability stdout end ----

@GuillaumeGomez

Copy link
Copy Markdown
Member

Thanks!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

📌 Commit d1da7c5 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 28, 2026
rust-bors Bot pushed a commit that referenced this pull request Jul 29, 2026
Rollup of 11 pull requests

Successful merges:

 - #158168 (Added implementation on `set_permissions_nofollow` for all primary platforms)
 - #160055 (Simplify `MaybeRequiresStorage`)
 - #157226 (Partially stabilize `box_vec_non_null`)
 - #158879 (simplify `slice::Iter[Mut]::next_chunk` implementation)
 - #159413 (Enable `#[diagnostic::on_unknown]` during late res)
 - #160091 (Fix rustdoc toolbar height when title is taller than one line)
 - #158615 (fix: don't fire `explicit_outlives_requirements` on `?Sized` type params)
 - #159666 (fix(ld64.lld): route version mismatch warnings to linker_info on macOS)
 - #160032 (rustdoc-json: Make `Stability` compatible with non-self-describing serde formats)
 - #160039 (Add regression test for enum unconstrained parameter )
 - #160049 (Use assert_eq! in splat codegen tests)
rust-bors Bot pushed a commit that referenced this pull request Jul 29, 2026
Rollup of 11 pull requests

Successful merges:

 - #158168 (Added implementation on `set_permissions_nofollow` for all primary platforms)
 - #160055 (Simplify `MaybeRequiresStorage`)
 - #157226 (Partially stabilize `box_vec_non_null`)
 - #158879 (simplify `slice::Iter[Mut]::next_chunk` implementation)
 - #159413 (Enable `#[diagnostic::on_unknown]` during late res)
 - #160091 (Fix rustdoc toolbar height when title is taller than one line)
 - #158615 (fix: don't fire `explicit_outlives_requirements` on `?Sized` type params)
 - #159666 (fix(ld64.lld): route version mismatch warnings to linker_info on macOS)
 - #160032 (rustdoc-json: Make `Stability` compatible with non-self-describing serde formats)
 - #160039 (Add regression test for enum unconstrained parameter )
 - #160049 (Use assert_eq! in splat codegen tests)
@rust-bors
rust-bors Bot merged commit e983685 into rust-lang:main Jul 29, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 29, 2026
rust-timer added a commit that referenced this pull request Jul 29, 2026
Rollup merge of #160032 - aDotInTheVoid:push-svrwoqqpoxsu, r=GuillaumeGomez

rustdoc-json: Make `Stability` compatible with non-self-describing serde formats

Using `#[serde(flatten)]` and `#[serde(tag = "` break using rustdoc-json-types with serde serializers like postcard. rustdoc-json-types should work with these, even if rustdoc itself doesn't use this yet.

This is a breaking change to the `FORMAT_VERSION` even though rust reader/writer code is uneffected.

cc @obi1kenobi
r? @GuillaumeGomez
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 S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants