From 826f656e28d2f0cec347e689374a93eb41789eed Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 22 Oct 2017 12:09:56 -0700 Subject: [PATCH] Compile and test the serde_derive "example" code --- serde_derive/Cargo.toml | 3 +++ serde_derive/src/lib.rs | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/serde_derive/Cargo.toml b/serde_derive/Cargo.toml index 2fdff19e..8ff79101 100644 --- a/serde_derive/Cargo.toml +++ b/serde_derive/Cargo.toml @@ -22,3 +22,6 @@ proc-macro = true quote = "0.3.8" serde_derive_internals = { version = "=0.16.0", default-features = false, path = "../serde_derive_internals" } syn = { version = "0.11", features = ["visit"] } + +[dev-dependencies] +serde = { version = "1.0", path = "../serde" } diff --git a/serde_derive/src/lib.rs b/serde_derive/src/lib.rs index 6cd3f923..50f07d19 100644 --- a/serde_derive/src/lib.rs +++ b/serde_derive/src/lib.rs @@ -8,8 +8,14 @@ //! This crate provides Serde's two derive macros. //! -//! ```rust,ignore +//! ```rust +//! # #[macro_use] +//! # extern crate serde_derive; +//! # //! #[derive(Serialize, Deserialize)] +//! # struct S; +//! # +//! # fn main() {} //! ``` //! //! Please refer to [https://serde.rs/derive.html] for how to set this up.