Skip to content

Commit fd7b255

Browse files
committed
1 parent 13a042d commit fd7b255

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<a name="v0.15.0"></a>
2+
# [v0.15.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.15.0) - 2022-09-05
3+
- Format Version: 19
4+
- Upstream Commit: [`b76a012be16de964c242594afba4323997f436b2`](https://github.com/rust-lang/rust/commit/b76a012be16de964c242594afba4323997f436b2)
5+
- Diff: [v0.15.0...v0.14.0](https://github.com/aDotInTheVoid/rustdoc-types/compare/v0.14.0...v0.15.0)
6+
17
<a name="v0.14.0"></a>
28
# [v0.14.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.14.0) - 2022-08-15
39
- Format Version: 18

COMMIT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4989f6a7247930ba027fa4b96a0c284f6ab02942
1+
b76a012be16de964c242594afba4323997f436b2

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustdoc-types"
3-
version = "0.14.0"
3+
version = "0.15.0"
44
authors = ["Nixon Enraght-Moony <[email protected]>", "The Rust Project Developers"]
55
edition = "2018"
66
license = "MIT OR Apache-2.0"

src/lib.rs

+19-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::path::PathBuf;
99
use serde::{Deserialize, Serialize};
1010

1111
/// rustdoc format-version.
12-
pub const FORMAT_VERSION: u32 = 18;
12+
pub const FORMAT_VERSION: u32 = 19;
1313

1414
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
1515
/// about the language items in the local crate, as well as info about external items to allow
@@ -308,11 +308,28 @@ pub struct Enum {
308308
#[serde(rename_all = "snake_case")]
309309
#[serde(tag = "variant_kind", content = "variant_inner")]
310310
pub enum Variant {
311-
Plain,
311+
Plain(Option<Discriminant>),
312312
Tuple(Vec<Type>),
313313
Struct(Vec<Id>),
314314
}
315315

316+
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
317+
pub struct Discriminant {
318+
/// The expression that produced the discriminant.
319+
///
320+
/// Unlike `value`, this preserves the original formatting (eg suffixes,
321+
/// hexadecimal, and underscores), making it unsuitable to be machine
322+
/// interpreted.
323+
///
324+
/// In some cases, when the value is to complex, this may be `"{ _ }"`.
325+
/// When this occurs is unstable, and may change without notice.
326+
pub expr: String,
327+
/// The numerical value of the discriminant. Stored as a string due to
328+
/// JSON's poor support for large integers, and the fact that it would need
329+
/// to store from [`i128::MIN`] to [`u128::MAX`].
330+
pub value: String,
331+
}
332+
316333
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
317334
#[serde(rename_all = "snake_case")]
318335
pub enum StructType {

0 commit comments

Comments
 (0)