From d28d000ef9f19e1b56ae20559593b693277ad3bb Mon Sep 17 00:00:00 2001 From: Kevin Butler Date: Tue, 3 Nov 2015 16:03:06 +0000 Subject: [PATCH] liblog: deny warnings in doctests --- mk/tests.mk | 3 ++- src/liblog/lib.rs | 4 +++- src/liblog/macros.rs | 8 +++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mk/tests.mk b/mk/tests.mk index 599d2ea4481..18d980da7d4 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -25,7 +25,8 @@ $(eval $(call RUST_CRATE,collectionstest)) TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system libc \ alloc_jemalloc,$(TARGET_CRATES)) \ collectionstest coretest -TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz +TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz \ + log TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \ rustc_trans rustc_lint,\ $(HOST_CRATES)) diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 9cb835bd852..1de7ebfffde 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -13,6 +13,7 @@ //! # Examples //! //! ``` +//! # #![feature(rustc_private)] //! #[macro_use] extern crate log; //! //! fn main() { @@ -167,7 +168,8 @@ #![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(deny(warnings))))] #![deny(missing_docs)] #![feature(box_syntax)] diff --git a/src/liblog/macros.rs b/src/liblog/macros.rs index 46b51f50c85..803a2df9ccc 100644 --- a/src/liblog/macros.rs +++ b/src/liblog/macros.rs @@ -19,6 +19,7 @@ /// # Examples /// /// ``` +/// # #![feature(rustc_private)] /// #[macro_use] extern crate log; /// /// fn main() { @@ -67,6 +68,7 @@ macro_rules! log { /// # Examples /// /// ``` +/// # #![feature(rustc_private)] /// #[macro_use] extern crate log; /// /// fn main() { @@ -92,6 +94,7 @@ macro_rules! error { /// # Examples /// /// ``` +/// # #![feature(rustc_private)] /// #[macro_use] extern crate log; /// /// fn main() { @@ -116,6 +119,7 @@ macro_rules! warn { /// # Examples /// /// ``` +/// # #![feature(rustc_private)] /// #[macro_use] extern crate log; /// /// fn main() { @@ -142,6 +146,7 @@ macro_rules! info { /// # Examples /// /// ``` +/// # #![feature(rustc_private)] /// #[macro_use] extern crate log; /// /// fn main() { @@ -165,9 +170,10 @@ macro_rules! debug { /// # Examples /// /// ``` +/// # #![feature(rustc_private)] /// #[macro_use] extern crate log; /// -/// struct Point { x: int, y: int } +/// struct Point { x: i32, y: i32 } /// fn some_expensive_computation() -> Point { Point { x: 1, y: 2 } } /// /// fn main() { -- 2.44.0