diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f96547..38df2d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,21 @@ +# [v0.59.0](https://github.com/rust-lang/rustdoc-types/releases/tag/v0.59.0) - 2026-06-26 + +**Breaking change**: Add `Item::const_stability` field +([rust#158343](https://github.com/rust-lang/rust/pull/158343)) + +- Format Version: 59 +- Upstream Commit: [`fee82a37e9eabf8afe6db62c0177baaf63356a98`](https://github.com/rust-lang/rust/commit/f8973b70ce31656cfd69bde2d20e6e8240448080) +- Diff: [v0.58.0...v0.59.0](https://github.com/rust-lang/rustdoc-types/compare/v0.58.0..v0.59.0) + # [v0.58.0](https://github.com/rust-lang/rustdoc-types/releases/tag/v0.58.0) - 2026-06-24 **Breaking change**: Add `Item::stability` field ([rust#158230](https://github.com/rust-lang/rust/pull/158230)) -- Format Version: 57 -- Upstream Commit: [`fee82a37e9eabf8afe6db62c0177baaf63356a98`](https://github.com/rust-lang/rust/commit/fee82a37e9eabf8afe6db62c0177baaf63356a98) -- Diff: [v0.57.3...v0.57.4](https://github.com/rust-lang/rustdoc-types/compare/v0.57.3...v0.57.4) +- Format Version: 58 +- Upstream Commit: [`fee82a37e9eabf8afe6db62c0177baaf63356a98`](https://github.com/rust-lang/rust/commit/da1a65818d47631f2a4f1459f7fb23559ce9ff3c) +- Diff: [v0.57.4...v0.58.0](https://github.com/rust-lang/rustdoc-types/compare/v0.57.4...v0.58.0) # [v0.57.4](https://github.com/rust-lang/rustdoc-types/releases/tag/v0.57.4) - 2026-06-19 diff --git a/COMMIT.txt b/COMMIT.txt index b60b364..5330f9d 100644 --- a/COMMIT.txt +++ b/COMMIT.txt @@ -1 +1 @@ -818d29d02798f5e48d28c868e4034294a7a38597 +f8973b70ce31656cfd69bde2d20e6e8240448080 diff --git a/Cargo.lock b/Cargo.lock index 22c9e12..c665b90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,7 +271,7 @@ checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" [[package]] name = "rustdoc-types" -version = "0.58.0" +version = "0.59.0" dependencies = [ "postcard", "rkyv", diff --git a/Cargo.toml b/Cargo.toml index daa41c0..1b9ce58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustdoc-types" -version = "0.58.0" +version = "0.59.0" edition = "2018" license = "MIT OR Apache-2.0" description = "Types for rustdoc's json output" diff --git a/src/lib.rs b/src/lib.rs index f248646..91e030f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -113,8 +113,8 @@ use serde_derive::{Deserialize, Serialize}; // will instead cause conflicts. See #94591 for more. (This paragraph and the "Latest feature" line // are deliberately not in a doc comment, because they need not be in public docs.) // -// Latest feature: Add `Item::stability`. -pub const FORMAT_VERSION: u32 = 58; +// Latest feature: Add `Item::const_stability`. +pub const FORMAT_VERSION: u32 = 59; /// The root of the emitted JSON blob. /// @@ -285,6 +285,8 @@ pub struct Item { /// - `#[doc = "Doc Comment"]` or `/// Doc comment`: see [`Self::docs`] instead. /// - `#[deprecated]` attributes: see the [`Self::deprecation`] field instead. /// - `#[stable]` and `#[unstable]` attributes: see the [`Self::stability`] field instead. + /// - `#[rustc_const_stable]` and `#[rustc_const_unstable]` attributes: + /// see the [`Self::const_stability`] field instead. /// /// Attributes appear in pretty-printed Rust form, regardless of their formatting /// in the original source code. For example: @@ -318,20 +320,31 @@ pub struct Item { /// most ordinary third-party crates usually have no data here. pub stability: Option>, + /// Stability information for using this item in const contexts, if any. + /// + /// This is separate from [`Self::stability`]. An item can be stable as regular API while its + /// const use is unstable. An unstable item may have no separate const-stability value here. + /// + /// This field is only populated for item kinds whose const behavior can have separate + /// stability information, such as const functions, const traits, const trait impls, + /// and associated items whose const behavior is controlled by a const trait or const impl. + pub const_stability: Option>, + /// The type-specific fields describing this item. pub inner: ItemEnum, } /// Stability information for an item. /// -/// This only refers to regular item stability: whether the item is stable or unstable -/// as represented by the `#[stable]` or `#[unstable]` attributes. -/// Const stability and default-body stability are different things and not captured here. +/// In [`Item::stability`], this refers to regular item stability: whether the item is +/// stable or unstable as represented by the `#[stable]` or `#[unstable]` attributes. +/// In [`Item::const_stability`], this refers to using the item in const contexts, +/// as represented by `#[rustc_const_stable]` or `#[rustc_const_unstable]`. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[cfg_attr(feature = "rkyv_0_8", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize))] #[cfg_attr(feature = "rkyv_0_8", rkyv(derive(Debug)))] pub struct Stability { - /// The stability feature associated with this item. + /// The feature associated with this stability record. /// /// For unstable items, this is the feature gate associated with the item. /// For stable items, this is the historical label recorded when the item was stabilized. @@ -341,7 +354,6 @@ pub struct Stability { pub level: StabilityLevel, } -/// Whether an item is stable or unstable as regular public API. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[cfg_attr(feature = "rkyv_0_8", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize))] #[cfg_attr(feature = "rkyv_0_8", rkyv(derive(Debug)))] @@ -364,6 +376,8 @@ pub enum StabilityLevel { /// - `#[doc = "Doc Comment"]` or `/// Doc comment`. These are in [`Item::docs`] instead. /// - `#[deprecated]`. These are in [`Item::deprecation`] instead. /// - `#[stable]` and `#[unstable]`. These are in [`Item::stability`] instead. +/// - `#[rustc_const_stable]` and `#[rustc_const_unstable]`. These are in +/// [`Item::const_stability`] instead. pub enum Attribute { /// `#[non_exhaustive]` NonExhaustive,