diff options
| author | Kevin Butler <haqkrs@gmail.com> | 2015-11-03 16:17:57 +0000 |
|---|---|---|
| committer | Kevin Butler <haqkrs@gmail.com> | 2015-11-12 05:16:53 +0000 |
| commit | a17f81b4b796123aa4e204145cca870fa270cf81 (patch) | |
| tree | f00e950a8cf67c5700e6611ab7f9aaf237b686c5 /src | |
| parent | 7ee329ac6ea4c9910e9b7c804cd24e93b6c80599 (diff) | |
| download | rust-a17f81b4b796123aa4e204145cca870fa270cf81.tar.gz rust-a17f81b4b796123aa4e204145cca870fa270cf81.zip | |
libserialize: deny warnings in doctests
Diffstat (limited to 'src')
| -rw-r--r-- | src/libserialize/json.rs | 9 | ||||
| -rw-r--r-- | src/libserialize/lib.rs | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 452feed3cdb..9e1e3c6a558 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -77,8 +77,9 @@ //! serialization API, using the derived serialization code. //! //! ```rust -//! extern crate serialize; -//! use serialize::json; +//! # #![feature(rustc_private)] +//! extern crate serialize as rustc_serialize; // for the deriving below +//! use rustc_serialize::json; //! //! // Automatically generate `Decodable` and `Encodable` trait implementations //! #[derive(RustcDecodable, RustcEncodable)] @@ -111,6 +112,7 @@ //! ### Simple example of `ToJson` usage //! //! ```rust +//! # #![feature(rustc_private)] //! extern crate serialize; //! use serialize::json::{self, ToJson, Json}; //! @@ -150,6 +152,7 @@ //! ### Verbose example of `ToJson` usage //! //! ```rust +//! # #![feature(rustc_private)] //! extern crate serialize; //! use std::collections::BTreeMap; //! use serialize::json::{self, Json, ToJson}; @@ -185,7 +188,7 @@ //! let json_str: String = json_obj.to_string(); //! //! // Deserialize like before -//! let decoded: TestStruct = json::decode(json_str)).unwrap(); +//! let decoded: TestStruct = json::decode(&json_str).unwrap(); //! } //! ``` diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 5b7bec41723..4a766f14531 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -26,7 +26,8 @@ Core encoding and decoding interfaces. #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", - html_playground_url = "https://play.rust-lang.org/")] + html_playground_url = "https://play.rust-lang.org/", + test(attr(allow(unused_variables), deny(warnings))))] #![feature(box_syntax)] #![feature(collections)] |
