@@ -9,7 +9,7 @@ use std::path::PathBuf;
99use 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 ) ]
617624pub 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