Skip to content

Commit

Permalink
v0.26.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aDotInTheVoid committed Jun 6, 2024
1 parent ad92b91 commit 9123889
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
<a name="v0.26.0"></a>
# [v0.26.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.26.0) - 2024-06-06

**Breaking Change**: Remove `type_` from `Constant`, and add it to `ItemEnum::Constant` ([rust#125958](https://github.com/rust-lang/rust/pull/125958)).

**Documentation Improvements**: [rust#125130](https://github.com/rust-lang/rust/pull/125130), [rust#124322](https://github.com/rust-lang/rust/pull/124322/).

- Format Version: 30
- Upstream Commit: [`432c11feb6ddfffe6d1d111624ac86386b2fe751`](https://github.com/rust-lang/rust/commit/432c11feb6ddfffe6d1d111624ac86386b2fe751)
- Diff: [v0.25.0...v0.26.0](https://github.com/aDotInTheVoid/rustdoc-types/compare/v0.25.0...v0.26.0)

<a name="v0.25.0"></a>
# [v0.25.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.25.0) - 2024-04-19

Expand Down
2 changes: 1 addition & 1 deletion COMMIT.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18ff131c4e06d6e1ebfc19092fe1d6c3535eb78b
432c11feb6ddfffe6d1d111624ac86386b2fe751
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.25.0"
version = "0.26.0"
edition = "2018"
license = "MIT OR Apache-2.0"
description = "Types for rustdoc's json output"
Expand Down
25 changes: 20 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
use std::path::PathBuf;

/// rustdoc format-version.
pub const FORMAT_VERSION: u32 = 29;
pub const FORMAT_VERSION: u32 = 30;

/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
/// about the language items in the local crate, as well as info about external items to allow
Expand Down Expand Up @@ -167,8 +167,6 @@ pub enum GenericArg {

#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Constant {
#[serde(rename = "type")]
pub type_: Type,
pub expr: String,
pub value: Option<String>,
pub is_literal: bool,
Expand All @@ -188,7 +186,19 @@ pub enum TypeBindingKind {
Constraint(Vec<GenericBound>),
}

/// An opaque identifier for an item.
///
/// It can be used to lookup in [Crate::index] or [Crate::paths] to resolve it
/// to an [Item].
///
/// Id's are only valid within a single JSON blob. They cannot be used to
/// resolve references between the JSON output's for different crates.
///
/// Rustdoc makes no guarantees about the inner value of Id's. Applications
/// should treat them as opaque keys to lookup items, and avoid attempting
/// to parse them, or otherwise depend on any implementation details.
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
// FIXME(aDotInTheVoid): Consider making this non-public in rustdoc-types.
pub struct Id(pub String);

#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
Expand Down Expand Up @@ -244,7 +254,12 @@ pub enum ItemEnum {

TypeAlias(TypeAlias),
OpaqueTy(OpaqueTy),
Constant(Constant),
Constant {
#[serde(rename = "type")]
type_: Type,
#[serde(rename = "const")]
const_: Constant,
},

Static(Static),

Expand Down Expand Up @@ -314,7 +329,7 @@ pub enum StructKind {
/// All [`Id`]'s will point to [`ItemEnum::StructField`]. Private and
/// `#[doc(hidden)]` fields will be given as `None`
Tuple(Vec<Option<Id>>),
/// A struct with nammed fields.
/// A struct with named fields.
///
/// ```rust
/// pub struct PlainStruct { x: i32 }
Expand Down

0 comments on commit 9123889

Please sign in to comment.