From dbdbd30bf2cb0d48c8bbce83c2458592664dbb18 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 14 Nov 2020 14:47:14 +0300 Subject: expand/resolve: Turn `#[derive]` into a regular macro attribute --- src/rustdoc-json-types/lib.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/rustdoc-json-types') diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index f4b8dc9a3ad..297fc95006b 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -96,8 +96,8 @@ pub struct Deprecation { pub note: Option, } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum Visibility { Public, /// For the most part items are private by default. The exceptions are associated items of @@ -112,8 +112,8 @@ pub enum Visibility { }, } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum GenericArgs { /// <'a, 32, B: Copy, C = u32> AngleBracketed { args: Vec, bindings: Vec }, @@ -121,8 +121,8 @@ pub enum GenericArgs { Parenthesized { inputs: Vec, output: Option }, } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum GenericArg { Lifetime(String), Type(Type), @@ -144,8 +144,8 @@ pub struct TypeBinding { pub binding: TypeBindingKind, } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum TypeBindingKind { Equality(Type), Constraint(Vec), @@ -154,8 +154,8 @@ pub enum TypeBindingKind { #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Id(pub String); -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum ItemKind { Module, ExternCrate, @@ -184,8 +184,8 @@ pub enum ItemKind { Keyword, } -#[serde(untagged)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(untagged)] pub enum ItemEnum { ModuleItem(Module), ExternCrateItem { @@ -264,17 +264,17 @@ pub struct Enum { pub impls: Vec, } +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "snake_case")] #[serde(tag = "variant_kind", content = "variant_inner")] -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] pub enum Variant { Plain, Tuple(Vec), Struct(Vec), } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum StructType { Plain, Tuple, @@ -310,24 +310,24 @@ pub struct GenericParamDef { pub kind: GenericParamDefKind, } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum GenericParamDefKind { Lifetime, Type { bounds: Vec, default: Option }, Const(Type), } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum WherePredicate { BoundPredicate { ty: Type, bounds: Vec }, RegionPredicate { lifetime: String, bounds: Vec }, EqPredicate { lhs: Type, rhs: Type }, } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum GenericBound { TraitBound { #[serde(rename = "trait")] @@ -339,17 +339,17 @@ pub enum GenericBound { Outlives(String), } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum TraitBoundModifier { None, Maybe, MaybeConst, } +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "snake_case")] #[serde(tag = "kind", content = "inner")] -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] pub enum Type { /// Structs, enums, and traits ResolvedPath { @@ -448,8 +448,8 @@ pub struct Impl { pub blanket_impl: Option, } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub struct Import { /// The full path being imported. pub span: String, @@ -468,8 +468,8 @@ pub struct ProcMacro { pub helpers: Vec, } -#[serde(rename_all = "snake_case")] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] pub enum MacroKind { /// A bang macro `foo!()`. Bang, -- cgit 1.4.1-3-g733a5