From 338e734d8153c09c727672776c87223dba822f03 Mon Sep 17 00:00:00 2001 From: Nixon Enraght-Moony Date: Wed, 7 Sep 2022 08:19:15 +0100 Subject: [PATCH] v0.16.0 https://github.com/rust-lang/rust/pull/101462 --- CHANGELOG.md | 6 ++++++ COMMIT.txt | 2 +- Cargo.toml | 2 +- src/lib.rs | 33 ++++++++++++++++++++++++++++++--- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0924ba..e70ac25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ + +# [v0.16.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.16.0) - 2022-09-07 +- Format Version: 20 +- Upstream Commit: [`065e0b9c9cf3d03f286c5d0b98fbae7185e41b75`](https://github.com/rust-lang/rust/commit/065e0b9c9cf3d03f286c5d0b98fbae7185e41b75) +- Diff: [v0.16.0...v0.15.0](https://github.com/aDotInTheVoid/rustdoc-types/compare/v0.15.0...v0.16.0) + # [v0.15.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.15.0) - 2022-09-05 - Format Version: 19 diff --git a/COMMIT.txt b/COMMIT.txt index b5c81e0..e018026 100644 --- a/COMMIT.txt +++ b/COMMIT.txt @@ -1 +1 @@ -b76a012be16de964c242594afba4323997f436b2 +065e0b9c9cf3d03f286c5d0b98fbae7185e41b75 diff --git a/Cargo.toml b/Cargo.toml index 4eb82ad..f65785f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustdoc-types" -version = "0.15.0" +version = "0.16.0" authors = ["Nixon Enraght-Moony ", "The Rust Project Developers"] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/src/lib.rs b/src/lib.rs index d25f68b..eea62f3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ use std::path::PathBuf; use serde::{Deserialize, Serialize}; /// rustdoc format-version. -pub const FORMAT_VERSION: u32 = 19; +pub const FORMAT_VERSION: u32 = 20; /// 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 @@ -308,9 +308,36 @@ pub struct Enum { #[serde(rename_all = "snake_case")] #[serde(tag = "variant_kind", content = "variant_inner")] pub enum Variant { + /// A variant with no parentheses, and possible discriminant. + /// + /// ```rust + /// enum Demo { + /// PlainVariant, + /// PlainWithDiscriminant = 1, + /// } + /// ``` Plain(Option), - Tuple(Vec), - Struct(Vec), + /// A variant with unnamed fields. + /// + /// Unlike most of json, `#[doc(hidden)]` fields will be given as `None` + /// instead of being ommited, because order matters. + /// + /// ```rust + /// enum Demo { + /// TupleVariant(i32), + /// EmptyTupleVariant(), + /// } + /// ``` + Tuple(Vec>), + /// A variant with named fields. + /// + /// ```rust + /// enum Demo { + /// StructVariant { x: i32 }, + /// EmptyStructVariant {}, + /// } + /// ``` + Struct { fields: Vec, fields_stripped: bool }, } #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]