Skip to content

Commit f857532

Browse files
committed
1 parent 1e078f7 commit f857532

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<a name="v0.20.0"></a>
2+
# [v0.20.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.20.0) - 2023-01-03
3+
- Format Version: 24
4+
- Upstream Commit: [`cca5d219e6801ebc2a62b455a12c657098a8af2d`](https://github.com/rust-lang/rust/commit/cca5d219e6801ebc2a62b455a12c657098a8af2d)
5+
- Diff: [v0.20.0...v0.19.0](https://github.com/aDotInTheVoid/rustdoc-types/compare/v0.19.0...v0.20.0)
6+
17
<a name="v0.19.0"></a>
28
# [v0.19.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.19.0) - 2022-11-21
39
- Format Version: 23

COMMIT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
30b7e44a3cabe1c21129253da54b21193f65ebe0
1+
cca5d219e6801ebc2a62b455a12c657098a8af2d

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.19.0"
3+
version = "0.20.0"
44
authors = ["Nixon Enraght-Moony <nixon.emoony@gmail.com>", "The Rust Project Developers"]
55
edition = "2018"
66
license = "MIT OR Apache-2.0"

src/lib.rs

+16-5
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 = 23;
12+
pub const FORMAT_VERSION: u32 = 24;
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
@@ -333,19 +333,26 @@ pub struct Enum {
333333
pub impls: Vec<Id>,
334334
}
335335

336+
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
337+
pub struct Variant {
338+
/// Whether the variant is plain, a tuple-like, or struct-like. Contains the fields.
339+
pub kind: VariantKind,
340+
/// The discriminant, if explicitly specified.
341+
pub discriminant: Option<Discriminant>,
342+
}
343+
336344
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
337345
#[serde(rename_all = "snake_case")]
338-
#[serde(tag = "variant_kind", content = "variant_inner")]
339-
pub enum Variant {
340-
/// A variant with no parentheses, and possible discriminant.
346+
pub enum VariantKind {
347+
/// A variant with no parentheses
341348
///
342349
/// ```rust
343350
/// enum Demo {
344351
/// PlainVariant,
345352
/// PlainWithDiscriminant = 1,
346353
/// }
347354
/// ```
348-
Plain(Option<Discriminant>),
355+
Plain,
349356
/// A variant with unnamed fields.
350357
///
351358
/// Unlike most of json, `#[doc(hidden)]` fields will be given as `None`
@@ -615,6 +622,10 @@ pub struct FunctionPointer {
615622

616623
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
617624
pub struct FnDecl {
625+
/// List of argument names and their type.
626+
///
627+
/// Note that not all names will be valid identifiers, as some of
628+
/// them may be patterns.
618629
pub inputs: Vec<(String, Type)>,
619630
pub output: Option<Type>,
620631
pub c_variadic: bool,

0 commit comments

Comments
 (0)