diff options
| author | Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> | 2023-05-22 18:17:52 +0100 |
|---|---|---|
| committer | Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> | 2023-05-22 18:22:08 +0100 |
| commit | a5e51013753ca75c239403b47af1e605f5af2a64 (patch) | |
| tree | 70c1c02274321292eebb8db3603ff83c80da08a2 /src/rustdoc-json-types | |
| parent | 48ec50ae39d0ca0baa0e78f56c395dcc6d7ebd65 (diff) | |
| download | rust-a5e51013753ca75c239403b47af1e605f5af2a64.tar.gz rust-a5e51013753ca75c239403b47af1e605f5af2a64.zip | |
Serialize all enums as externally tagged to guarantee compatibility with binary formats such as bincode or postcard
Diffstat (limited to 'src/rustdoc-json-types')
| -rw-r--r-- | src/rustdoc-json-types/lib.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 3556834071f..ba8eeaa6682 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; use std::path::PathBuf; /// rustdoc format-version. -pub const FORMAT_VERSION: u32 = 25; +pub const FORMAT_VERSION: u32 = 26; /// 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 @@ -83,7 +83,6 @@ pub struct Item { /// Stringified versions of the attributes on this item (e.g. `"#[inline]"`) pub attrs: Vec<String>, pub deprecation: Option<Deprecation>, - #[serde(flatten)] pub inner: ItemEnum, } @@ -222,7 +221,7 @@ pub enum ItemKind { } #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[serde(tag = "kind", content = "inner", rename_all = "snake_case")] +#[serde(rename_all = "snake_case")] pub enum ItemEnum { Module(Module), ExternCrate { @@ -543,7 +542,6 @@ pub enum Term { #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] -#[serde(tag = "kind", content = "inner")] pub enum Type { /// Structs, enums, and unions ResolvedPath(Path), |
