mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-25 23:17:56 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c61b20cceb | |||
| 42987a5b24 | |||
| 3f28a93240 | |||
| 9970084550 | |||
| 3920993370 | |||
| 22690cedc2 | |||
| b27039d34d | |||
| 1b6fd5a362 | |||
| 8b7b886036 |
+1
-1
@@ -24,7 +24,7 @@ script:
|
|||||||
- (cd serde && travis-cargo --only nightly build -- --no-default-features --features collections)
|
- (cd serde && travis-cargo --only nightly build -- --no-default-features --features collections)
|
||||||
- (cd testing && travis-cargo --skip nightly test)
|
- (cd testing && travis-cargo --skip nightly test)
|
||||||
- (cd testing && travis-cargo --only nightly test -- --features unstable-testing)
|
- (cd testing && travis-cargo --only nightly test -- --features unstable-testing)
|
||||||
- (cd serde_macros && travis-cargo --only nightly test -- --features unstable-testing)
|
- (cd serde_derive && travis-cargo --only nightly test)
|
||||||
- (cd examples/serde-syntex-example && travis-cargo --skip nightly run)
|
- (cd examples/serde-syntex-example && travis-cargo --skip nightly run)
|
||||||
- (cd examples/serde-syntex-example && travis-cargo --only nightly run -- --no-default-features --features unstable)
|
- (cd examples/serde-syntex-example && travis-cargo --only nightly run -- --no-default-features --features unstable)
|
||||||
- (cd serde && travis-cargo --only stable doc)
|
- (cd serde && travis-cargo --only stable doc)
|
||||||
|
|||||||
@@ -15,8 +15,10 @@ You may be looking for:
|
|||||||
## Serde in action
|
## Serde in action
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#![feature(plugin, custom_derive)]
|
#![feature(rustc_macro)]
|
||||||
#![plugin(serde_macros)]
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ build = "build.rs"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["serde_codegen"]
|
default = ["serde_codegen"]
|
||||||
unstable = ["serde_macros"]
|
unstable = ["serde_derive"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
serde_codegen = { version = "^0.8", optional = true, path = "../../serde_codegen" }
|
serde_codegen = { version = "^0.8", optional = true, path = "../../serde_codegen" }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = "^0.8"
|
serde = "^0.8"
|
||||||
|
serde_derive = { version = "^0.8", optional = true, path = "../../serde_derive" }
|
||||||
serde_json = "^0.8"
|
serde_json = "^0.8"
|
||||||
serde_macros = { version = "^0.8", optional = true, path = "../../serde_macros" }
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#[cfg(not(feature = "serde_macros"))]
|
#[cfg(not(feature = "serde_derive"))]
|
||||||
mod inner {
|
mod inner {
|
||||||
extern crate serde_codegen;
|
extern crate serde_codegen;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ mod inner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "serde_macros")]
|
#[cfg(feature = "serde_derive")]
|
||||||
mod inner {
|
mod inner {
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
#![cfg_attr(feature = "serde_macros", feature(custom_derive, plugin))]
|
#![cfg_attr(feature = "serde_derive", feature(rustc_macro))]
|
||||||
#![cfg_attr(feature = "serde_macros", plugin(serde_macros))]
|
|
||||||
|
#[cfg(feature = "serde_derive")]
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
|
|
||||||
#[cfg(feature = "serde_macros")]
|
#[cfg(feature = "serde_derive")]
|
||||||
include!("main.rs.in");
|
include!("main.rs.in");
|
||||||
|
|
||||||
#[cfg(not(feature = "serde_macros"))]
|
#[cfg(not(feature = "serde_derive"))]
|
||||||
include!(concat!(env!("OUT_DIR"), "/main.rs"));
|
include!(concat!(env!("OUT_DIR"), "/main.rs"));
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "0.8.10"
|
version = "0.8.11"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "A generic serialization/deserialization framework"
|
description = "A generic serialization/deserialization framework"
|
||||||
|
|||||||
@@ -809,7 +809,7 @@ map_impl!(
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[cfg(all(feature = "unstable", feature = "std"))]
|
#[cfg(feature = "std")]
|
||||||
impl Deserialize for net::IpAddr {
|
impl Deserialize for net::IpAddr {
|
||||||
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error>
|
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error>
|
||||||
where D: Deserializer,
|
where D: Deserializer,
|
||||||
|
|||||||
@@ -640,15 +640,12 @@ impl Serialize for Duration {
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[cfg(all(feature = "std", feature = "unstable"))]
|
#[cfg(feature = "std")]
|
||||||
impl Serialize for net::IpAddr {
|
impl Serialize for net::IpAddr {
|
||||||
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
|
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
|
||||||
where S: Serializer,
|
where S: Serializer,
|
||||||
{
|
{
|
||||||
match *self {
|
self.to_string().serialize(serializer)
|
||||||
net::IpAddr::V4(ref addr) => addr.serialize(serializer),
|
|
||||||
net::IpAddr::V6(ref addr) => addr.serialize(serializer),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_codegen"
|
name = "serde_codegen"
|
||||||
version = "0.8.10"
|
version = "0.8.11"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "Macros to auto-generate implementations for the serde framework"
|
description = "Macros to auto-generate implementations for the serde framework"
|
||||||
|
|||||||
@@ -651,14 +651,6 @@ fn deserialize_field_visitor(
|
|||||||
Some(quote!(__ignore,))
|
Some(quote!(__ignore,))
|
||||||
};
|
};
|
||||||
|
|
||||||
let field_enum = quote! {
|
|
||||||
#[allow(non_camel_case_types)]
|
|
||||||
enum __Field {
|
|
||||||
#(field_idents,)*
|
|
||||||
#ignore_variant
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let index_field_arms: Vec<_> = field_idents.iter()
|
let index_field_arms: Vec<_> = field_idents.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(field_index, field_ident)| {
|
.map(|(field_index, field_ident)| {
|
||||||
@@ -745,6 +737,14 @@ fn deserialize_field_visitor(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let field_enum = quote! {
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
enum __Field {
|
||||||
|
#(field_idents,)*
|
||||||
|
#ignore_variant
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let impl_item = quote! {
|
let impl_item = quote! {
|
||||||
impl _serde::de::Deserialize for __Field {
|
impl _serde::de::Deserialize for __Field {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "0.8.10"
|
version = "0.8.11"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
||||||
@@ -15,12 +15,13 @@ name = "serde_derive"
|
|||||||
rustc-macro = true
|
rustc-macro = true
|
||||||
|
|
||||||
[dependencies.serde_codegen]
|
[dependencies.serde_codegen]
|
||||||
version = "=0.8.10"
|
version = "=0.8.11"
|
||||||
path = "../serde_codegen"
|
path = "../serde_codegen"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["with-syn"]
|
features = ["with-syn"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
compiletest_rs = "^0.2.0"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
serde = { version = "0.8.10", path = "../serde" }
|
serde = { version = "0.8.11", path = "../serde" }
|
||||||
serde_test = { version = "0.8.10", path = "../serde_test" }
|
serde_test = { version = "0.8.11", path = "../serde_test" }
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
struct S {
|
||||||
|
#[serde(rename="x", serialize="y")] //~^^ HELP: unknown serde field attribute `serialize`
|
||||||
|
x: (),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
struct S {
|
||||||
|
#[serde(rename="x")]
|
||||||
|
#[serde(rename(deserialize="y"))] //~^^^ HELP: duplicate serde attribute `rename`
|
||||||
|
x: (),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
struct S {
|
||||||
|
#[serde(rename(serialize="x"), rename(serialize="y"))] //~^^ HELP: duplicate serde attribute `rename`
|
||||||
|
x: (),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
struct S {
|
||||||
|
#[serde(rename(serialize="x"))]
|
||||||
|
#[serde(rename="y")] //~^^^ HELP: duplicate serde attribute `rename`
|
||||||
|
x: (),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
struct S {
|
||||||
|
#[serde(rename(serialize="x", serialize="y"))] //~^^ HELP: duplicate serde attribute `rename`
|
||||||
|
x: (),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
struct S {
|
||||||
|
#[serde(rename(serialize="x"))]
|
||||||
|
#[serde(rename(serialize="y"))] //~^^^ HELP: duplicate serde attribute `rename`
|
||||||
|
x: (),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
struct Test<'a> {
|
||||||
|
s: &'a str, //~^^ HELP: Serde does not support deserializing fields of type &str
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
#[serde(abc="xyz")] //~^ HELP: unknown serde container attribute `abc`
|
||||||
|
struct A {
|
||||||
|
x: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() { }
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
struct C {
|
||||||
|
#[serde(abc="xyz")] //~^^ HELP: unknown serde field attribute `abc`
|
||||||
|
x: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() { }
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#![feature(rustc_macro)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
#[derive(Serialize)] //~ ERROR: custom derive attribute panicked
|
||||||
|
enum E {
|
||||||
|
#[serde(abc="xyz")] //~^^ HELP: unknown serde variant attribute `abc`
|
||||||
|
V,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() { }
|
||||||
+4
-3
@@ -1,8 +1,9 @@
|
|||||||
#![feature(custom_derive, plugin)]
|
#![feature(rustc_macro)]
|
||||||
#![plugin(serde_macros, clippy)]
|
|
||||||
|
|
||||||
#![deny(identity_op)]
|
#![deny(identity_op)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
// The derived implementation uses 0+1 to add up the number of fields
|
// The derived implementation uses 0+1 to add up the number of fields
|
||||||
// serialized, which Clippy warns about. If the expansion info is registered
|
// serialized, which Clippy warns about. If the expansion info is registered
|
||||||
// correctly, the Clippy lint is not triggered.
|
// correctly, the Clippy lint is not triggered.
|
||||||
@@ -6,3 +6,5 @@ extern crate serde_derive;
|
|||||||
extern crate test;
|
extern crate test;
|
||||||
|
|
||||||
include!("../../testing/tests/test.rs.in");
|
include!("../../testing/tests/test.rs.in");
|
||||||
|
|
||||||
|
mod compile_tests;
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
# To prevent compiletest from seeing two versions of serde
|
|
||||||
paths = ["../serde"]
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/target
|
|
||||||
/Cargo.lock
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "serde_macros"
|
|
||||||
version = "0.8.9"
|
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
|
||||||
license = "MIT/Apache-2.0"
|
|
||||||
description = "Macros to auto-generate implementations for the serde framework"
|
|
||||||
homepage = "https://serde.rs"
|
|
||||||
repository = "https://github.com/serde-rs/serde"
|
|
||||||
documentation = "https://serde.rs/codegen.html"
|
|
||||||
keywords = ["serde", "serialization"]
|
|
||||||
include = ["Cargo.toml", "src/**/*.rs"]
|
|
||||||
|
|
||||||
[lib]
|
|
||||||
name = "serde_macros"
|
|
||||||
plugin = true
|
|
||||||
|
|
||||||
[features]
|
|
||||||
unstable-testing = [
|
|
||||||
"clippy",
|
|
||||||
"serde/unstable-testing",
|
|
||||||
"serde_codegen/unstable-testing"
|
|
||||||
]
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
clippy = { version = "^0.*", optional = true }
|
|
||||||
serde_codegen = { version = "=0.8.9", default-features = false, features = ["unstable"], path = "../serde_codegen" }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
compiletest_rs = "^0.2.0"
|
|
||||||
fnv = "1.0"
|
|
||||||
rustc-serialize = "^0.3.16"
|
|
||||||
serde = { version = "0.8.9", path = "../serde" }
|
|
||||||
serde_test = { version = "0.8.9", path = "../serde_test" }
|
|
||||||
|
|
||||||
[[test]]
|
|
||||||
name = "test"
|
|
||||||
path = "tests/test.rs"
|
|
||||||
|
|
||||||
[[bench]]
|
|
||||||
name = "bench"
|
|
||||||
path = "benches/bench.rs"
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#![feature(custom_attribute, custom_derive, plugin, test)]
|
|
||||||
#![cfg_attr(feature = "clippy", plugin(clippy))]
|
|
||||||
#![plugin(serde_macros)]
|
|
||||||
|
|
||||||
extern crate rustc_serialize;
|
|
||||||
extern crate serde;
|
|
||||||
extern crate test;
|
|
||||||
|
|
||||||
include!("../../testing/benches/bench.rs.in");
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#![feature(plugin_registrar, rustc_private)]
|
|
||||||
#![cfg_attr(feature = "clippy", feature(plugin))]
|
|
||||||
#![cfg_attr(feature = "clippy", plugin(clippy))]
|
|
||||||
|
|
||||||
extern crate serde_codegen;
|
|
||||||
extern crate rustc_plugin;
|
|
||||||
|
|
||||||
#[plugin_registrar]
|
|
||||||
#[doc(hidden)]
|
|
||||||
pub fn plugin_registrar(reg: &mut rustc_plugin::Registry) {
|
|
||||||
serde_codegen::register(reg);
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
#![feature(custom_attribute, custom_derive, plugin)]
|
|
||||||
#![plugin(serde_macros)]
|
|
||||||
|
|
||||||
#[derive(Serialize)] //~ ERROR: 6 errors:
|
|
||||||
struct S {
|
|
||||||
#[serde(rename(serialize="x"))]
|
|
||||||
#[serde(rename(serialize="y"))] // ERROR: duplicate serde attribute `rename`
|
|
||||||
a: (),
|
|
||||||
|
|
||||||
#[serde(rename(serialize="x"))]
|
|
||||||
#[serde(rename="y")] // ERROR: duplicate serde attribute `rename`
|
|
||||||
b: (),
|
|
||||||
|
|
||||||
#[serde(rename(serialize="x"))]
|
|
||||||
#[serde(rename(deserialize="y"))] // ok
|
|
||||||
c: (),
|
|
||||||
|
|
||||||
#[serde(rename="x")]
|
|
||||||
#[serde(rename(deserialize="y"))] // ERROR: duplicate serde attribute `rename`
|
|
||||||
d: (),
|
|
||||||
|
|
||||||
#[serde(rename(serialize="x", serialize="y"))] // ERROR: duplicate serde attribute `rename`
|
|
||||||
e: (),
|
|
||||||
|
|
||||||
#[serde(rename="x", serialize="y")] // ERROR: unknown serde field attribute `serialize`
|
|
||||||
f: (),
|
|
||||||
|
|
||||||
#[serde(rename(serialize="x"), rename(serialize="y"))] // ERROR: duplicate serde attribute `rename`
|
|
||||||
g: (),
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
#![feature(custom_attribute, custom_derive, plugin)]
|
|
||||||
#![plugin(serde_macros)]
|
|
||||||
|
|
||||||
extern crate serde;
|
|
||||||
|
|
||||||
#[derive(Serialize)] //~ unknown serde container attribute `abc`
|
|
||||||
#[serde(abc="xyz")]
|
|
||||||
struct A {
|
|
||||||
x: u32,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize)] //~ unknown serde container attribute `abc`
|
|
||||||
#[serde(abc="xyz")]
|
|
||||||
struct B {
|
|
||||||
x: u32,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Serialize)] //~ unknown serde field attribute `abc`
|
|
||||||
struct C {
|
|
||||||
#[serde(abc="xyz")]
|
|
||||||
x: u32,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize)] //~ unknown serde field attribute `abc`
|
|
||||||
struct D {
|
|
||||||
#[serde(abc="xyz")]
|
|
||||||
x: u32,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() { }
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#![feature(custom_attribute, custom_derive, plugin)]
|
|
||||||
#![plugin(serde_macros)]
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)] //~ ERROR: Serde does not support deserializing fields of type &str
|
|
||||||
struct Test<'a> {
|
|
||||||
s: &'a str,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#![feature(test, custom_attribute, custom_derive, plugin)]
|
|
||||||
#![plugin(serde_macros)]
|
|
||||||
|
|
||||||
extern crate test;
|
|
||||||
|
|
||||||
include!("../../testing/tests/test.rs.in");
|
|
||||||
|
|
||||||
mod compile_tests;
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_test"
|
name = "serde_test"
|
||||||
version = "0.8.10"
|
version = "0.8.11"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "Token De/Serializer for testing De/Serialize implementations"
|
description = "Token De/Serializer for testing De/Serialize implementations"
|
||||||
@@ -12,4 +12,4 @@ keywords = ["serde", "serialization"]
|
|||||||
include = ["Cargo.toml", "src/**/*.rs"]
|
include = ["Cargo.toml", "src/**/*.rs"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "0.8.10", path = "../serde" }
|
serde = { version = "0.8.11", path = "../serde" }
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_testing"
|
name = "serde_testing"
|
||||||
version = "0.8.10"
|
version = "0.8.11"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "A generic serialization/deserialization framework"
|
description = "A generic serialization/deserialization framework"
|
||||||
|
|||||||
Reference in New Issue
Block a user