Skip to content

Commit d93ed29

Browse files
committed
liblog: deny warnings in doctests
1 parent 2a0b283 commit d93ed29

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

mk/tests.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ $(eval $(call RUST_CRATE,collectionstest))
2525
TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system \
2626
alloc_jemalloc,$(TARGET_CRATES)) \
2727
collectionstest coretest
28-
TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz
28+
TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz \
29+
log
2930
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \
3031
rustc_trans rustc_lint,\
3132
$(HOST_CRATES))

src/liblog/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//! # Examples
1414
//!
1515
//! ```
16+
//! # #![feature(rustc_private)]
1617
//! #[macro_use] extern crate log;
1718
//!
1819
//! fn main() {
@@ -167,7 +168,8 @@
167168
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
168169
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
169170
html_root_url = "https://doc.rust-lang.org/nightly/",
170-
html_playground_url = "https://play.rust-lang.org/")]
171+
html_playground_url = "https://play.rust-lang.org/",
172+
test(attr(deny(warnings))))]
171173
#![deny(missing_docs)]
172174

173175
#![feature(box_syntax)]

src/liblog/macros.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
/// # Examples
2020
///
2121
/// ```
22+
/// # #![feature(rustc_private)]
2223
/// #[macro_use] extern crate log;
2324
///
2425
/// fn main() {
@@ -67,6 +68,7 @@ macro_rules! log {
6768
/// # Examples
6869
///
6970
/// ```
71+
/// # #![feature(rustc_private)]
7072
/// #[macro_use] extern crate log;
7173
///
7274
/// fn main() {
@@ -92,6 +94,7 @@ macro_rules! error {
9294
/// # Examples
9395
///
9496
/// ```
97+
/// # #![feature(rustc_private)]
9598
/// #[macro_use] extern crate log;
9699
///
97100
/// fn main() {
@@ -116,6 +119,7 @@ macro_rules! warn {
116119
/// # Examples
117120
///
118121
/// ```
122+
/// # #![feature(rustc_private)]
119123
/// #[macro_use] extern crate log;
120124
///
121125
/// fn main() {
@@ -142,6 +146,7 @@ macro_rules! info {
142146
/// # Examples
143147
///
144148
/// ```
149+
/// # #![feature(rustc_private)]
145150
/// #[macro_use] extern crate log;
146151
///
147152
/// fn main() {
@@ -165,9 +170,10 @@ macro_rules! debug {
165170
/// # Examples
166171
///
167172
/// ```
173+
/// # #![feature(rustc_private)]
168174
/// #[macro_use] extern crate log;
169175
///
170-
/// struct Point { x: int, y: int }
176+
/// struct Point { x: i32, y: i32 }
171177
/// fn some_expensive_computation() -> Point { Point { x: 1, y: 2 } }
172178
///
173179
/// fn main() {

0 commit comments

Comments
 (0)