Include default-stability info in rustdoc JSON.#158468
Open
obi1kenobi wants to merge 1 commit into
Open
Conversation
Collaborator
|
rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing cc @CraftSpider, @Enselic |
Member
Author
|
CI failure because of edition 2021 in the tool. Upgrading to edition 2024 here: #158470 Will rebase this as soon as that PR merges. |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.