Skip to content

Commit 9123889

Browse files
committed
v0.26.0
1 parent ad92b91 commit 9123889

File tree

4 files changed

+33
-7
lines changed

4 files changed

+33
-7
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
<a name="v0.26.0"></a>
2+
# [v0.26.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.26.0) - 2024-06-06
3+
4+
**Breaking Change**: Remove `type_` from `Constant`, and add it to `ItemEnum::Constant` ([rust#125958](https://github.com/rust-lang/rust/pull/125958)).
5+
6+
**Documentation Improvements**: [rust#125130](https://github.com/rust-lang/rust/pull/125130), [rust#124322](https://github.com/rust-lang/rust/pull/124322/).
7+
8+
- Format Version: 30
9+
- Upstream Commit: [`432c11feb6ddfffe6d1d111624ac86386b2fe751`](https://github.com/rust-lang/rust/commit/432c11feb6ddfffe6d1d111624ac86386b2fe751)
10+
- Diff: [v0.25.0...v0.26.0](https://github.com/aDotInTheVoid/rustdoc-types/compare/v0.25.0...v0.26.0)
11+
112
<a name="v0.25.0"></a>
213
# [v0.25.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.25.0) - 2024-04-19
314

COMMIT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18ff131c4e06d6e1ebfc19092fe1d6c3535eb78b
1+
432c11feb6ddfffe6d1d111624ac86386b2fe751

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustdoc-types"
3-
version = "0.25.0"
3+
version = "0.26.0"
44
edition = "2018"
55
license = "MIT OR Apache-2.0"
66
description = "Types for rustdoc's json output"

src/lib.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
88
use std::path::PathBuf;
99

1010
/// rustdoc format-version.
11-
pub const FORMAT_VERSION: u32 = 29;
11+
pub const FORMAT_VERSION: u32 = 30;
1212

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

168168
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
169169
pub struct Constant {
170-
#[serde(rename = "type")]
171-
pub type_: Type,
172170
pub expr: String,
173171
pub value: Option<String>,
174172
pub is_literal: bool,
@@ -188,7 +186,19 @@ pub enum TypeBindingKind {
188186
Constraint(Vec<GenericBound>),
189187
}
190188

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

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

245255
TypeAlias(TypeAlias),
246256
OpaqueTy(OpaqueTy),
247-
Constant(Constant),
257+
Constant {
258+
#[serde(rename = "type")]
259+
type_: Type,
260+
#[serde(rename = "const")]
261+
const_: Constant,
262+
},
248263

249264
Static(Static),
250265

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

0 commit comments

Comments
 (0)