@@ -9,7 +9,7 @@ use std::path::PathBuf;
9
9
use serde:: { Deserialize , Serialize } ;
10
10
11
11
/// rustdoc format-version.
12
- pub const FORMAT_VERSION : u32 = 23 ;
12
+ pub const FORMAT_VERSION : u32 = 24 ;
13
13
14
14
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
15
15
/// about the language items in the local crate, as well as info about external items to allow
@@ -333,19 +333,26 @@ pub struct Enum {
333
333
pub impls : Vec < Id > ,
334
334
}
335
335
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
+
336
344
#[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
337
345
#[ 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
341
348
///
342
349
/// ```rust
343
350
/// enum Demo {
344
351
/// PlainVariant,
345
352
/// PlainWithDiscriminant = 1,
346
353
/// }
347
354
/// ```
348
- Plain ( Option < Discriminant > ) ,
355
+ Plain ,
349
356
/// A variant with unnamed fields.
350
357
///
351
358
/// Unlike most of json, `#[doc(hidden)]` fields will be given as `None`
@@ -615,6 +622,10 @@ pub struct FunctionPointer {
615
622
616
623
#[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
617
624
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.
618
629
pub inputs : Vec < ( String , Type ) > ,
619
630
pub output : Option < Type > ,
620
631
pub c_variadic : bool ,
0 commit comments