Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

<a name="v0.58.0"></a>
# [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)

<a name="v0.57.4"></a>
# [v0.57.4](https://github.com/rust-lang/rustdoc-types/releases/tag/v0.57.4) - 2026-06-19
Expand Down
2 changes: 1 addition & 1 deletion COMMIT.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
818d29d02798f5e48d28c868e4034294a7a38597
f8973b70ce31656cfd69bde2d20e6e8240448080
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
28 changes: 21 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -318,20 +320,31 @@ pub struct Item {
/// most ordinary third-party crates usually have no data here.
pub stability: Option<Box<Stability>>,

/// 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<Box<Stability>>,

/// 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.
Expand All @@ -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)))]
Expand All @@ -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,
Expand Down