Include default-stability info in rustdoc JSON.#158468
Conversation
|
rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing cc @CraftSpider, @Enselic |
|
CI failure because of edition 2021 in the tool. Upgrading to edition 2024 here: #158470 Will rebase this as soon as that PR merges. EDIT: Now done. |
This comment has been minimized.
This comment has been minimized.
2e055e1 to
bd938c5
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
That path is currently unreachable. Perhaps Hittng that path today would require that Rust add an explicitly-stable equivalent of Is there some other way I can use to signal the unreachability of that path? I used |
|
No it's fine as is. Just curious if it could be triggered. If it's not supposed to, then all good! @bors r+ rollup |
…ty, r=GuillaumeGomez Include default-stability info in rustdoc JSON. Add a `default_unstable` field on associated constants, associated types, and functions. The field is populated only when those items appear inside a trait, only when there's a default present, and when that default is not stable as designated by `#[rustc_default_body_unstable]`. In such a case, the field contains the name of the feature required to use the unstable default. The purpose of this info is to allow `cargo-semver-checks` to lint the standard library for accidental breakage of stable APIs. Removing a stable default is an example of such breakage, while removing an _unstable_ default is not. The field is boxed to minimize the size impact on its enclosing type, since for regular crates it will always be `None`. I also updated `jsondoclint` to assert that it's an error to have a populated `default_unstable` when there's no function body, no default const value, or no default associated type. In the process, I noticed that `jsondoclint` and `jsondocck` are both on edition 2021 — I plan to upgrade them to 2024 in separate PRs. 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.
…ty, r=GuillaumeGomez Include default-stability info in rustdoc JSON. Add a `default_unstable` field on associated constants, associated types, and functions. The field is populated only when those items appear inside a trait, only when there's a default present, and when that default is not stable as designated by `#[rustc_default_body_unstable]`. In such a case, the field contains the name of the feature required to use the unstable default. The purpose of this info is to allow `cargo-semver-checks` to lint the standard library for accidental breakage of stable APIs. Removing a stable default is an example of such breakage, while removing an _unstable_ default is not. The field is boxed to minimize the size impact on its enclosing type, since for regular crates it will always be `None`. I also updated `jsondoclint` to assert that it's an error to have a populated `default_unstable` when there's no function body, no default const value, or no default associated type. In the process, I noticed that `jsondoclint` and `jsondocck` are both on edition 2021 — I plan to upgrade them to 2024 in separate PRs. 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.
Rollup of 6 pull requests Successful merges: - #158073 (bootstrap: fix panic when repo path contains spaces by switching to CARGO_ENCODED_RUSTFLAGS) - #158256 (Avoid parser panics bubbling out to proc macros) - #158081 (trait-system: Recover deferred closure calls after errors) - #158323 (rustc: improve diagnostics for file-open failures) - #158327 (Move attribute and keyword docs from `std` to `core`) - #158468 (Include default-stability info in rustdoc JSON.)
…ty, r=GuillaumeGomez Include default-stability info in rustdoc JSON. Add a `default_unstable` field on associated constants, associated types, and functions. The field is populated only when those items appear inside a trait, only when there's a default present, and when that default is not stable as designated by `#[rustc_default_body_unstable]`. In such a case, the field contains the name of the feature required to use the unstable default. The purpose of this info is to allow `cargo-semver-checks` to lint the standard library for accidental breakage of stable APIs. Removing a stable default is an example of such breakage, while removing an _unstable_ default is not. The field is boxed to minimize the size impact on its enclosing type, since for regular crates it will always be `None`. I also updated `jsondoclint` to assert that it's an error to have a populated `default_unstable` when there's no function body, no default const value, or no default associated type. In the process, I noticed that `jsondoclint` and `jsondocck` are both on edition 2021 — I plan to upgrade them to 2024 in separate PRs. 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.
Rollup of 12 pull requests Successful merges: - #158073 (bootstrap: fix panic when repo path contains spaces by switching to CARGO_ENCODED_RUSTFLAGS) - #158169 (Fix debuginfo compression in bootstrap) - #158256 (Avoid parser panics bubbling out to proc macros) - #158375 (Support `DefKind::InlineConst` in `ConstKind::Unevaluated`) - #158417 (Avoid ICE when cfg_eval recovers no item from derive input) - #158556 (delegation: store child segment flag in `PathSegment`) - #158561 (Avoid building rustdoc for tests without doctests) - #158562 (Improve tracing of steps in bootstrap) - #157445 (Allow section override when using patchable-function-entries) - #158081 (trait-system: Recover deferred closure calls after errors) - #158327 (Move attribute and keyword docs from `std` to `core`) - #158468 (Include default-stability info in rustdoc JSON.)
…ty, r=GuillaumeGomez Include default-stability info in rustdoc JSON. Add a `default_unstable` field on associated constants, associated types, and functions. The field is populated only when those items appear inside a trait, only when there's a default present, and when that default is not stable as designated by `#[rustc_default_body_unstable]`. In such a case, the field contains the name of the feature required to use the unstable default. The purpose of this info is to allow `cargo-semver-checks` to lint the standard library for accidental breakage of stable APIs. Removing a stable default is an example of such breakage, while removing an _unstable_ default is not. The field is boxed to minimize the size impact on its enclosing type, since for regular crates it will always be `None`. I also updated `jsondoclint` to assert that it's an error to have a populated `default_unstable` when there's no function body, no default const value, or no default associated type. In the process, I noticed that `jsondoclint` and `jsondocck` are both on edition 2021 — I plan to upgrade them to 2024 in separate PRs. 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.
…ty, r=GuillaumeGomez Include default-stability info in rustdoc JSON. Add a `default_unstable` field on associated constants, associated types, and functions. The field is populated only when those items appear inside a trait, only when there's a default present, and when that default is not stable as designated by `#[rustc_default_body_unstable]`. In such a case, the field contains the name of the feature required to use the unstable default. The purpose of this info is to allow `cargo-semver-checks` to lint the standard library for accidental breakage of stable APIs. Removing a stable default is an example of such breakage, while removing an _unstable_ default is not. The field is boxed to minimize the size impact on its enclosing type, since for regular crates it will always be `None`. I also updated `jsondoclint` to assert that it's an error to have a populated `default_unstable` when there's no function body, no default const value, or no default associated type. In the process, I noticed that `jsondoclint` and `jsondocck` are both on edition 2021 — I plan to upgrade them to 2024 in separate PRs. 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.
…ty, r=GuillaumeGomez Include default-stability info in rustdoc JSON. Add a `default_unstable` field on associated constants, associated types, and functions. The field is populated only when those items appear inside a trait, only when there's a default present, and when that default is not stable as designated by `#[rustc_default_body_unstable]`. In such a case, the field contains the name of the feature required to use the unstable default. The purpose of this info is to allow `cargo-semver-checks` to lint the standard library for accidental breakage of stable APIs. Removing a stable default is an example of such breakage, while removing an _unstable_ default is not. The field is boxed to minimize the size impact on its enclosing type, since for regular crates it will always be `None`. I also updated `jsondoclint` to assert that it's an error to have a populated `default_unstable` when there's no function body, no default const value, or no default associated type. In the process, I noticed that `jsondoclint` and `jsondocck` are both on edition 2021 — I plan to upgrade them to 2024 in separate PRs. 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 16 pull requests Successful merges: - #155722 (Introduce aarch64-unknown-linux-pauthtest target) - #156230 (tests: check wasm compiler_builtins object architecture) - #158073 (bootstrap: fix panic when repo path contains spaces by switching to CARGO_ENCODED_RUSTFLAGS) - #158169 (Fix debuginfo compression in bootstrap) - #158256 (Avoid parser panics bubbling out to proc macros) - #158375 (Support `DefKind::InlineConst` in `ConstKind::Unevaluated`) - #158556 (delegation: store child segment flag in `PathSegment`) - #158561 (Avoid building rustdoc for tests without doctests) - #158562 (Improve tracing of steps in bootstrap) - #157445 (Allow section override when using patchable-function-entries) - #158081 (trait-system: Recover deferred closure calls after errors) - #158327 (Move attribute and keyword docs from `std` to `core`) - #158468 (Include default-stability info in rustdoc JSON.) - #158564 (fix `-Z min-recursion-limit` unstable chapter name) - #158568 (llvm-wrapper: use accessors for private fields in LLVM 23+) - #158582 (Comment on needed RAM in huge-stacks.rs)
…uwer Rollup of 16 pull requests Successful merges: - #155722 (Introduce aarch64-unknown-linux-pauthtest target) - #156230 (tests: check wasm compiler_builtins object architecture) - #158073 (bootstrap: fix panic when repo path contains spaces by switching to CARGO_ENCODED_RUSTFLAGS) - #158169 (Fix debuginfo compression in bootstrap) - #158256 (Avoid parser panics bubbling out to proc macros) - #158375 (Support `DefKind::InlineConst` in `ConstKind::Unevaluated`) - #158556 (delegation: store child segment flag in `PathSegment`) - #158561 (Avoid building rustdoc for tests without doctests) - #158562 (Improve tracing of steps in bootstrap) - #157445 (Allow section override when using patchable-function-entries) - #158081 (trait-system: Recover deferred closure calls after errors) - #158327 (Move attribute and keyword docs from `std` to `core`) - #158468 (Include default-stability info in rustdoc JSON.) - #158564 (fix `-Z min-recursion-limit` unstable chapter name) - #158568 (llvm-wrapper: use accessors for private fields in LLVM 23+) - #158582 (Comment on needed RAM in huge-stacks.rs)
|
@bors try jobs=dist-x86_64-msvc |
This comment has been minimized.
This comment has been minimized.
Include default-stability info in rustdoc JSON. try-job: dist-x86_64-msvc
…uwer Rollup of 11 pull requests Successful merges: - #155722 (Introduce aarch64-unknown-linux-pauthtest target) - #156230 (tests: check wasm compiler_builtins object architecture) - #156295 (Pass the whole `GenericArgs` to `Interner::for_each_relevant_impl()`) - #158375 (Support `DefKind::InlineConst` in `ConstKind::Unevaluated`) - #158556 (delegation: store child segment flag in `PathSegment`) - #158081 (trait-system: Recover deferred closure calls after errors) - #158468 (Include default-stability info in rustdoc JSON.) - #158543 (Note usage of documentation hard links in `core::io`) - #158564 (fix `-Z min-recursion-limit` unstable chapter name) - #158568 (llvm-wrapper: use accessors for private fields in LLVM 23+) - #158582 (Comment on needed RAM in huge-stacks.rs)
…uwer Rollup of 11 pull requests Successful merges: - #155722 (Introduce aarch64-unknown-linux-pauthtest target) - #156230 (tests: check wasm compiler_builtins object architecture) - #156295 (Pass the whole `GenericArgs` to `Interner::for_each_relevant_impl()`) - #158375 (Support `DefKind::InlineConst` in `ConstKind::Unevaluated`) - #158556 (delegation: store child segment flag in `PathSegment`) - #158081 (trait-system: Recover deferred closure calls after errors) - #158468 (Include default-stability info in rustdoc JSON.) - #158543 (Note usage of documentation hard links in `core::io`) - #158564 (fix `-Z min-recursion-limit` unstable chapter name) - #158568 (llvm-wrapper: use accessors for private fields in LLVM 23+) - #158582 (Comment on needed RAM in huge-stacks.rs)
…uwer Rollup of 11 pull requests Successful merges: - #155722 (Introduce aarch64-unknown-linux-pauthtest target) - #156230 (tests: check wasm compiler_builtins object architecture) - #156295 (Pass the whole `GenericArgs` to `Interner::for_each_relevant_impl()`) - #158375 (Support `DefKind::InlineConst` in `ConstKind::Unevaluated`) - #158556 (delegation: store child segment flag in `PathSegment`) - #158081 (trait-system: Recover deferred closure calls after errors) - #158468 (Include default-stability info in rustdoc JSON.) - #158543 (Note usage of documentation hard links in `core::io`) - #158564 (fix `-Z min-recursion-limit` unstable chapter name) - #158568 (llvm-wrapper: use accessors for private fields in LLVM 23+) - #158582 (Comment on needed RAM in huge-stacks.rs)
Rollup merge of #158468 - obi1kenobi:pg/default-body-stability, r=GuillaumeGomez Include default-stability info in rustdoc JSON. Add a `default_unstable` field on associated constants, associated types, and functions. The field is populated only when those items appear inside a trait, only when there's a default present, and when that default is not stable as designated by `#[rustc_default_body_unstable]`. In such a case, the field contains the name of the feature required to use the unstable default. The purpose of this info is to allow `cargo-semver-checks` to lint the standard library for accidental breakage of stable APIs. Removing a stable default is an example of such breakage, while removing an _unstable_ default is not. The field is boxed to minimize the size impact on its enclosing type, since for regular crates it will always be `None`. I also updated `jsondoclint` to assert that it's an error to have a populated `default_unstable` when there's no function body, no default const value, or no default associated type. In the process, I noticed that `jsondoclint` and `jsondocck` are both on edition 2021 — I plan to upgrade them to 2024 in separate PRs. 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.
Add a
default_unstablefield on associated constants, associated types, and functions. The field is populated only when those items appear inside a trait, only when there's a default present, and when that default is not stable as designated by#[rustc_default_body_unstable]. In such a case, the field contains the name of the feature required to use the unstable default.The purpose of this info is to allow
cargo-semver-checksto lint the standard library for accidental breakage of stable APIs. Removing a stable default is an example of such breakage, while removing an unstable default is not.The field is boxed to minimize the size impact on its enclosing type, since for regular crates it will always be
None.I also updated
jsondoclintto assert that it's an error to have a populateddefault_unstablewhen there's no function body, no default const value, or no default associated type. In the process, I noticed thatjsondoclintandjsondocckare both on edition 2021 — I plan to upgrade them to 2024 in separate PRs.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.