Include Item::stability info in rustdoc JSON.#158230
Conversation
This is motivated by cargo-semver-checks wanting to work on the standard library, but that requires being able to filter out breaking changes to unstable items, so it can only flag breaking changes to stable items. This in turn is motivated by https://www.github.com/rust-lang/rust/issues/153486.
|
These commits modify Please ensure that if you've changed the output:
rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing |
|
Nothing to say except: nice work! @bors r+ rollup |
…oc-json, r=GuillaumeGomez Include `Item::stability` info in rustdoc JSON. Include `Item::stability` info in rustdoc JSON, to enable tools like `cargo-semver-checks` to compute stability information and (eventually, soon™️) be used to catch accidental breaking changes in the Rust standard library (cc @Amanieu). Successor to rust-lang#154603 by @aDotInTheVoid, building directly on top of its commit. Differences relative to that PR: - Added `since` information for stable items. - `Stability` is now boxed to ensure a smaller bump in `Item` size. Most non-built-in crates won't have stability information, so minimizing that memory use is material for them. - We have well-defined stability semantics for items, optimizing for consistency with how existing JSON users already must perform reachability and `#[doc(hidden)]` analysis, instead of how rustdoc HTML presentation works. Note the detailed inline comment about this. - Tests and docs, which the original PR noted needed to be added. Other flavors of stability, such as const stability or default-body stability, are left as future work. r? @GuillaumeGomez **AI disclosure:** This PR is the product of a combination of manual work and AI tools. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.
…oc-json, r=GuillaumeGomez Include `Item::stability` info in rustdoc JSON. Include `Item::stability` info in rustdoc JSON, to enable tools like `cargo-semver-checks` to compute stability information and (eventually, soon™️) be used to catch accidental breaking changes in the Rust standard library (cc @Amanieu). Successor to rust-lang#154603 by @aDotInTheVoid, building directly on top of its commit. Differences relative to that PR: - Added `since` information for stable items. - `Stability` is now boxed to ensure a smaller bump in `Item` size. Most non-built-in crates won't have stability information, so minimizing that memory use is material for them. - We have well-defined stability semantics for items, optimizing for consistency with how existing JSON users already must perform reachability and `#[doc(hidden)]` analysis, instead of how rustdoc HTML presentation works. Note the detailed inline comment about this. - Tests and docs, which the original PR noted needed to be added. Other flavors of stability, such as const stability or default-body stability, are left as future work. r? @GuillaumeGomez **AI disclosure:** This PR is the product of a combination of manual work and AI tools. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.
…oc-json, r=GuillaumeGomez Include `Item::stability` info in rustdoc JSON. Include `Item::stability` info in rustdoc JSON, to enable tools like `cargo-semver-checks` to compute stability information and (eventually, soon™️) be used to catch accidental breaking changes in the Rust standard library (cc @Amanieu). Successor to rust-lang#154603 by @aDotInTheVoid, building directly on top of its commit. Differences relative to that PR: - Added `since` information for stable items. - `Stability` is now boxed to ensure a smaller bump in `Item` size. Most non-built-in crates won't have stability information, so minimizing that memory use is material for them. - We have well-defined stability semantics for items, optimizing for consistency with how existing JSON users already must perform reachability and `#[doc(hidden)]` analysis, instead of how rustdoc HTML presentation works. Note the detailed inline comment about this. - Tests and docs, which the original PR noted needed to be added. Other flavors of stability, such as const stability or default-body stability, are left as future work. r? @GuillaumeGomez **AI disclosure:** This PR is the product of a combination of manual work and AI tools. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.
…uwer Rollup of 5 pull requests Successful merges: - #155811 (Include AtomicU128/AtomicI128 in docs for any target) - #158242 (Fix linking for wasm with crate metadata included) - #158119 (Refactor `proc_macro_decls_static`) - #158172 (update `asm_experimental_reg` comments) - #158230 (Include `Item::stability` info in rustdoc JSON.)
…oc-json, r=GuillaumeGomez Include `Item::stability` info in rustdoc JSON. Include `Item::stability` info in rustdoc JSON, to enable tools like `cargo-semver-checks` to compute stability information and (eventually, soon™️) be used to catch accidental breaking changes in the Rust standard library (cc @Amanieu). Successor to rust-lang#154603 by @aDotInTheVoid, building directly on top of its commit. Differences relative to that PR: - Added `since` information for stable items. - `Stability` is now boxed to ensure a smaller bump in `Item` size. Most non-built-in crates won't have stability information, so minimizing that memory use is material for them. - We have well-defined stability semantics for items, optimizing for consistency with how existing JSON users already must perform reachability and `#[doc(hidden)]` analysis, instead of how rustdoc HTML presentation works. Note the detailed inline comment about this. - Tests and docs, which the original PR noted needed to be added. Other flavors of stability, such as const stability or default-body stability, are left as future work. r? @GuillaumeGomez **AI disclosure:** This PR is the product of a combination of manual work and AI tools. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.
…uwer Rollup of 7 pull requests Successful merges: - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158242 (Fix linking for wasm with crate metadata included) - #158119 (Refactor `proc_macro_decls_static`) - #158172 (update `asm_experimental_reg` comments) - #158230 (Include `Item::stability` info in rustdoc JSON.) - #158258 (Use an unexpanded span for actually written down opt out params) - #158262 (Change compiler leads in triagebot.toml)
…uwer Rollup of 8 pull requests Successful merges: - #158242 (Fix linking for wasm with crate metadata included) - #157978 (Avoid `&raw` recovery ICE after trailing comma) - #158119 (Refactor `proc_macro_decls_static`) - #158171 (rustdoc: Avoid ICE on unevaluated `type const` projections in array lengths) - #158172 (update `asm_experimental_reg` comments) - #158230 (Include `Item::stability` info in rustdoc JSON.) - #158258 (Use an unexpanded span for actually written down opt out params) - #158262 (Change compiler leads in triagebot.toml)
…uwer Rollup of 8 pull requests Successful merges: - #158242 (Fix linking for wasm with crate metadata included) - #157978 (Avoid `&raw` recovery ICE after trailing comma) - #158119 (Refactor `proc_macro_decls_static`) - #158171 (rustdoc: Avoid ICE on unevaluated `type const` projections in array lengths) - #158172 (update `asm_experimental_reg` comments) - #158230 (Include `Item::stability` info in rustdoc JSON.) - #158258 (Use an unexpanded span for actually written down opt out params) - #158262 (Change compiler leads in triagebot.toml)
…uwer Rollup of 8 pull requests Successful merges: - #158242 (Fix linking for wasm with crate metadata included) - #157978 (Avoid `&raw` recovery ICE after trailing comma) - #158119 (Refactor `proc_macro_decls_static`) - #158171 (rustdoc: Avoid ICE on unevaluated `type const` projections in array lengths) - #158172 (update `asm_experimental_reg` comments) - #158230 (Include `Item::stability` info in rustdoc JSON.) - #158258 (Use an unexpanded span for actually written down opt out params) - #158262 (Change compiler leads in triagebot.toml)
…uwer Rollup of 8 pull requests Successful merges: - #158242 (Fix linking for wasm with crate metadata included) - #157978 (Avoid `&raw` recovery ICE after trailing comma) - #158119 (Refactor `proc_macro_decls_static`) - #158171 (rustdoc: Avoid ICE on unevaluated `type const` projections in array lengths) - #158172 (update `asm_experimental_reg` comments) - #158230 (Include `Item::stability` info in rustdoc JSON.) - #158258 (Use an unexpanded span for actually written down opt out params) - #158262 (Change compiler leads in triagebot.toml)
Rollup merge of #158230 - obi1kenobi:pg/item-stability-rustdoc-json, r=GuillaumeGomez Include `Item::stability` info in rustdoc JSON. Include `Item::stability` info in rustdoc JSON, to enable tools like `cargo-semver-checks` to compute stability information and (eventually, soon™️) be used to catch accidental breaking changes in the Rust standard library (cc @Amanieu). Successor to #154603 by @aDotInTheVoid, building directly on top of its commit. Differences relative to that PR: - Added `since` information for stable items. - `Stability` is now boxed to ensure a smaller bump in `Item` size. Most non-built-in crates won't have stability information, so minimizing that memory use is material for them. - We have well-defined stability semantics for items, optimizing for consistency with how existing JSON users already must perform reachability and `#[doc(hidden)]` analysis, instead of how rustdoc HTML presentation works. Note the detailed inline comment about this. - Tests and docs, which the original PR noted needed to be added. Other flavors of stability, such as const stability or default-body stability, are left as future work. r? @GuillaumeGomez **AI disclosure:** This PR is the product of a combination of manual work and AI tools. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.
|
Thank you! I had good mentors :) Would you be open to me making a follow-up PR to also expose const stability, and perhaps another follow-up for default-body stability as well? These are less important for checking external SemVer but will be nice for checking the standard library itself for accidental breaking changes around those partial stabilizations. I think const stability is the easiest next PR, and would just be another boxed field on |
|
Go ahead! |
Include
Item::stabilityinfo in rustdoc JSON, to enable tools likecargo-semver-checksto compute stability information and (eventually, soon™️) be used to catch accidental breaking changes in the Rust standard library (cc @Amanieu).Successor to #154603 by @aDotInTheVoid, building directly on top of its commit.
Differences relative to that PR:
sinceinformation for stable items.Stabilityis now boxed to ensure a smaller bump inItemsize. Most non-built-in crates won't have stability information, so minimizing that memory use is material for them.#[doc(hidden)]analysis, instead of how rustdoc HTML presentation works. Note the detailed inline comment about this.Other flavors of stability, such as const stability or default-body stability, are left as future work.
r? @GuillaumeGomez
AI disclosure: This PR is the product of a combination of manual work and AI tools. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.