From 32163cd53b460cba11414d2739a971084e32fba8 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Fri, 12 Feb 2016 21:06:47 -0800 Subject: [PATCH] feat(cargo): Version bump --- serde/Cargo.toml | 4 ++-- serde_codegen/Cargo.toml | 18 +++++++++--------- serde_codegen/src/attr.rs | 18 +++++++++--------- serde_codegen/src/de.rs | 12 ++++++------ serde_codegen/src/lib.rs | 21 +++++++++++---------- serde_codegen/src/ser.rs | 8 ++++---- serde_macros/Cargo.toml | 8 ++++---- serde_tests/Cargo.toml | 12 ++++++------ 8 files changed, 51 insertions(+), 50 deletions(-) diff --git a/serde/Cargo.toml b/serde/Cargo.toml index c4fb239f..125f4196 100644 --- a/serde/Cargo.toml +++ b/serde/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde" -version = "0.6.11" +version = "0.6.12" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A generic serialization/deserialization framework" @@ -17,5 +17,5 @@ num-impls = ["num-bigint", "num-complex", "num-rational"] num-rational = ["num/rational"] [dependencies] -clippy = { version = "^0.0.37", optional = true } +clippy = { version = "^0.0.39", optional = true } num = { version = "^0.1.27", default-features = false } diff --git a/serde_codegen/Cargo.toml b/serde_codegen/Cargo.toml index 8cd05f5e..46b3ec8a 100644 --- a/serde_codegen/Cargo.toml +++ b/serde_codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_codegen" -version = "0.6.11" +version = "0.6.12" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "Macros to auto-generate implementations for the serde framework" @@ -16,13 +16,13 @@ nightly-testing = ["clippy"] with-syntex = ["quasi/with-syntex", "quasi_codegen", "quasi_codegen/with-syntex", "syntex", "syntex_syntax"] [build-dependencies] -quasi_codegen = { version = "^0.4.0", optional = true } -syntex = { version = "^0.26.0", optional = true } +quasi_codegen = { version = "^0.5.0", optional = true } +syntex = { version = "^0.27.0", optional = true } [dependencies] -aster = { version = "^0.10.0", default-features = false } -clippy = { version = "^0.0.37", optional = true } -quasi = { version = "^0.4.0", default-features = false } -quasi_macros = { version = "^0.4.0", optional = true } -syntex = { version = "^0.26.0", optional = true } -syntex_syntax = { version = "^0.26.0", optional = true } +aster = { version = "^0.11.0", default-features = false } +clippy = { version = "^0.0.39", optional = true } +quasi = { version = "^0.5.0", default-features = false } +quasi_macros = { version = "^0.5.0", optional = true } +syntex = { version = "^0.27.0", optional = true } +syntex_syntax = { version = "^0.27.0", optional = true } diff --git a/serde_codegen/src/attr.rs b/serde_codegen/src/attr.rs index be54f683..92dad5bb 100644 --- a/serde_codegen/src/attr.rs +++ b/serde_codegen/src/attr.rs @@ -151,7 +151,7 @@ impl<'a> FieldAttrsBuilder<'a> { pub fn attr(mut self, attr: &ast::Attribute) -> Result, ()> { match attr.node.value.node { - ast::MetaList(ref name, ref items) if name == &"serde" => { + ast::MetaItemKind::List(ref name, ref items) if name == &"serde" => { attr::mark_used(&attr); for item in items { self = try!(self.meta_item(item)); @@ -167,15 +167,15 @@ impl<'a> FieldAttrsBuilder<'a> { pub fn meta_item(mut self, meta_item: &P) -> Result, ()> { match meta_item.node { - ast::MetaNameValue(ref name, ref lit) if name == &"rename" => { + ast::MetaItemKind::NameValue(ref name, ref lit) if name == &"rename" => { let expr = self.builder.expr().build_lit(P(lit.clone())); Ok(self.name(expr)) } - ast::MetaList(ref name, ref items) if name == &"rename" => { + ast::MetaItemKind::List(ref name, ref items) if name == &"rename" => { for item in items { match item.node { - ast::MetaNameValue(ref name, ref lit) => { + ast::MetaItemKind::NameValue(ref name, ref lit) => { let name = self.builder.expr().str(name); let expr = self.builder.expr().build_lit(P(lit.clone())); @@ -187,16 +187,16 @@ impl<'a> FieldAttrsBuilder<'a> { Ok(self) } - ast::MetaWord(ref name) if name == &"default" => { + ast::MetaItemKind::Word(ref name) if name == &"default" => { Ok(self.default()) } - ast::MetaWord(ref name) if name == &"skip_serializing" => { + ast::MetaItemKind::Word(ref name) if name == &"skip_serializing" => { Ok(self.skip_serializing_field()) } - ast::MetaWord(ref name) if name == &"skip_serializing_if_empty" => { + ast::MetaItemKind::Word(ref name) if name == &"skip_serializing_if_empty" => { Ok(self.skip_serializing_field_if_empty()) } - ast::MetaWord(ref name) if name == &"skip_serializing_if_none" => { + ast::MetaItemKind::Word(ref name) if name == &"skip_serializing_if_none" => { Ok(self.skip_serializing_field_if_none()) } _ => { @@ -285,7 +285,7 @@ impl<'a> ContainerAttrsBuilder<'a> { pub fn attr(mut self, attr: &ast::Attribute) -> Result { match attr.node.value.node { - ast::MetaList(ref name, ref items) if name == &"serde" => { + ast::MetaItemKind::List(ref name, ref items) if name == &"serde" => { attr::mark_used(&attr); for item in items { self = try!(self.meta_item(item)); diff --git a/serde_codegen/src/de.rs b/serde_codegen/src/de.rs index a327993c..a8aefd19 100644 --- a/serde_codegen/src/de.rs +++ b/serde_codegen/src/de.rs @@ -37,8 +37,8 @@ pub fn expand_derive_deserialize( let builder = aster::AstBuilder::new().span(span); let generics = match item.node { - ast::ItemStruct(_, ref generics) => generics, - ast::ItemEnum(_, ref generics) => generics, + ast::ItemKind::Struct(_, ref generics) => generics, + ast::ItemKind::Enum(_, ref generics) => generics, _ => { cx.span_err( meta_item.span, @@ -92,7 +92,7 @@ fn deserialize_body( let _ = try!(field::container_attrs(cx, item)); match item.node { - ast::ItemStruct(ref variant_data, _) => { + ast::ItemKind::Struct(ref variant_data, _) => { deserialize_item_struct( cx, builder, @@ -103,7 +103,7 @@ fn deserialize_body( variant_data, ) } - ast::ItemEnum(ref enum_def, _) => { + ast::ItemKind::Enum(ref enum_def, _) => { deserialize_item_enum( cx, builder, @@ -558,7 +558,7 @@ fn deserialize_item_enum( .collect() ); - let variants_expr = builder.expr().addr_of().slice() + let variants_expr = builder.expr().ref_().slice() .with_exprs( enum_def.variants.iter() .map(|variant| { @@ -944,7 +944,7 @@ fn deserialize_struct_visitor( fields, )); - let fields_expr = builder.expr().addr_of().slice() + let fields_expr = builder.expr().ref_().slice() .with_exprs( fields.iter() .map(|field| { diff --git a/serde_codegen/src/lib.rs b/serde_codegen/src/lib.rs index a2699c78..a5159080 100644 --- a/serde_codegen/src/lib.rs +++ b/serde_codegen/src/lib.rs @@ -1,5 +1,6 @@ #![cfg_attr(feature = "nightly-testing", plugin(clippy))] -#![cfg_attr(feature = "nightly", allow(used_underscore_binding))] +#![cfg_attr(feature = "nightly-testing", feature(plugin))] +#![cfg_attr(feature = "nightly-testing", allow(used_underscore_binding))] #![cfg_attr(not(feature = "with-syntex"), feature(rustc_private, plugin))] #![cfg_attr(not(feature = "with-syntex"), plugin(quasi_macros))] @@ -31,14 +32,6 @@ include!("lib.rs.in"); pub fn register(reg: &mut syntex::Registry) { use syntax::{ast, fold}; - reg.add_attr("feature(custom_derive)"); - reg.add_attr("feature(custom_attribute)"); - - reg.add_decorator("derive_Serialize", ser::expand_derive_serialize); - reg.add_decorator("derive_Deserialize", de::expand_derive_deserialize); - - reg.add_post_expansion_pass(strip_attributes); - /// Strip the serde attributes from the crate. #[cfg(feature = "with-syntex")] fn strip_attributes(krate: ast::Crate) -> ast::Crate { @@ -48,7 +41,7 @@ pub fn register(reg: &mut syntex::Registry) { impl fold::Folder for StripAttributeFolder { fn fold_attribute(&mut self, attr: ast::Attribute) -> Option { match attr.node.value.node { - ast::MetaList(ref n, _) if n == &"serde" => { return None; } + ast::MetaItemKind::List(ref n, _) if n == &"serde" => { return None; } _ => {} } @@ -62,6 +55,14 @@ pub fn register(reg: &mut syntex::Registry) { fold::Folder::fold_crate(&mut StripAttributeFolder, krate) } + + reg.add_attr("feature(custom_derive)"); + reg.add_attr("feature(custom_attribute)"); + + reg.add_decorator("derive_Serialize", ser::expand_derive_serialize); + reg.add_decorator("derive_Deserialize", de::expand_derive_deserialize); + + reg.add_post_expansion_pass(strip_attributes); } #[cfg(not(feature = "with-syntex"))] diff --git a/serde_codegen/src/ser.rs b/serde_codegen/src/ser.rs index 241e4dcd..229ebc31 100644 --- a/serde_codegen/src/ser.rs +++ b/serde_codegen/src/ser.rs @@ -33,8 +33,8 @@ pub fn expand_derive_serialize( let builder = aster::AstBuilder::new().span(span); let generics = match item.node { - ast::ItemStruct(_, ref generics) => generics, - ast::ItemEnum(_, ref generics) => generics, + ast::ItemKind::Struct(_, ref generics) => generics, + ast::ItemKind::Enum(_, ref generics) => generics, _ => { cx.span_err( meta_item.span, @@ -88,7 +88,7 @@ fn serialize_body( let _ = try!(field::container_attrs(cx, item)); match item.node { - ast::ItemStruct(ref variant_data, _) => { + ast::ItemKind::Struct(ref variant_data, _) => { serialize_item_struct( cx, builder, @@ -99,7 +99,7 @@ fn serialize_body( variant_data, ) } - ast::ItemEnum(ref enum_def, _) => { + ast::ItemKind::Enum(ref enum_def, _) => { serialize_item_enum( cx, builder, diff --git a/serde_macros/Cargo.toml b/serde_macros/Cargo.toml index d4a57b68..5b02d7f3 100644 --- a/serde_macros/Cargo.toml +++ b/serde_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_macros" -version = "0.6.11" +version = "0.6.12" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "Macros to auto-generate implementations for the serde framework" @@ -16,14 +16,14 @@ plugin = true nightly-testing = ["clippy", "serde/nightly-testing", "serde_codegen/nightly-testing"] [dependencies] -clippy = { version = "^0.0.37", optional = true } -serde_codegen = { version = "^0.6.10", path = "../serde_codegen", default-features = false, features = ["nightly"] } +clippy = { version = "^0.0.39", optional = true } +serde_codegen = { version = "^0.6.12", path = "../serde_codegen", default-features = false, features = ["nightly"] } [dev-dependencies] compiletest_rs = "^0.0.11" num = "^0.1.27" rustc-serialize = "^0.3.16" -serde = { version = "^0.6.10", path = "../serde", features = ["num-impls"] } +serde = { version = "^0.6.12", path = "../serde", features = ["num-impls"] } [[test]] name = "test" diff --git a/serde_tests/Cargo.toml b/serde_tests/Cargo.toml index 4a64b152..130d9dd4 100644 --- a/serde_tests/Cargo.toml +++ b/serde_tests/Cargo.toml @@ -14,18 +14,18 @@ build = "build.rs" nightly-testing = ["clippy", "serde/nightly-testing", "serde_codegen/nightly-testing"] [build-dependencies] -syntex = { version = "^0.26.0" } -syntex_syntax = { version = "^0.26.0" } -serde_codegen = { version = "*", path = "../serde_codegen", features = ["with-syntex"] } +syntex = { version = "^0.27.0" } +syntex_syntax = { version = "^0.27.0" } +serde_codegen = { version = "^0.6.12", path = "../serde_codegen", features = ["with-syntex"] } [dev-dependencies] -num = "^0.1.27" +num = "^0.1.26" rustc-serialize = "^0.3.16" serde = { version = "*", path = "../serde", features = ["num-impls"] } -syntex = "^0.26.0" +syntex = "^0.27.0" [dependencies] -clippy = { version = "^0.0.37", optional = true } +clippy = { version = "^0.0.39", optional = true } [[test]] name = "test"