@@ -9,7 +9,7 @@ use std::path::PathBuf;
99use serde:: { Deserialize , Serialize } ;
1010
1111/// rustdoc format-version.
12- pub const FORMAT_VERSION : u32 = 19 ;
12+ pub const FORMAT_VERSION : u32 = 20 ;
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,9 +308,36 @@ pub struct Enum {
308308#[ serde( rename_all = "snake_case" ) ]
309309#[ serde( tag = "variant_kind" , content = "variant_inner" ) ]
310310pub enum Variant {
311+ /// A variant with no parentheses, and possible discriminant.
312+ ///
313+ /// ```rust
314+ /// enum Demo {
315+ /// PlainVariant,
316+ /// PlainWithDiscriminant = 1,
317+ /// }
318+ /// ```
311319 Plain ( Option < Discriminant > ) ,
312- Tuple ( Vec < Type > ) ,
313- Struct ( Vec < Id > ) ,
320+ /// A variant with unnamed fields.
321+ ///
322+ /// Unlike most of json, `#[doc(hidden)]` fields will be given as `None`
323+ /// instead of being ommited, because order matters.
324+ ///
325+ /// ```rust
326+ /// enum Demo {
327+ /// TupleVariant(i32),
328+ /// EmptyTupleVariant(),
329+ /// }
330+ /// ```
331+ Tuple ( Vec < Option < Id > > ) ,
332+ /// A variant with named fields.
333+ ///
334+ /// ```rust
335+ /// enum Demo {
336+ /// StructVariant { x: i32 },
337+ /// EmptyStructVariant {},
338+ /// }
339+ /// ```
340+ Struct { fields : Vec < Id > , fields_stripped : bool } ,
314341}
315342
316343#[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
0 commit comments