From 64241eef367dd6989b85951b20527926b49473c6 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 5 Jan 2021 20:25:50 +0900 Subject: [PATCH] Allow unused_variables lint in doctests --- core/src/lib.rs | 5 ++++- derive/src/lib.rs | 5 ++++- src/lib.rs | 7 +++++-- tests/doc/lib.rs | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index e5a9da20..2c542ddd 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -2,7 +2,10 @@ #![doc(test( no_crate_inject, - attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code)) + attr( + deny(warnings, rust_2018_idioms, single_use_lifetimes), + allow(dead_code, unused_variables) + ) ))] #![forbid(unsafe_code)] #![warn(future_incompatible, rust_2018_idioms, unreachable_pub)] diff --git a/derive/src/lib.rs b/derive/src/lib.rs index 85ef6f4b..36244348 100644 --- a/derive/src/lib.rs +++ b/derive/src/lib.rs @@ -2,7 +2,10 @@ #![doc(test( no_crate_inject, - attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code)) + attr( + deny(warnings, rust_2018_idioms, single_use_lifetimes), + allow(dead_code, unused_variables) + ) ))] #![forbid(unsafe_code)] #![warn(future_incompatible, rust_2018_idioms, single_use_lifetimes, unreachable_pub)] diff --git a/src/lib.rs b/src/lib.rs index 54a64828..307bbb72 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -822,7 +822,7 @@ //! fn func2(x: i32) { //! // Unlike `feature(impl_trait_in_bindings)`, this works on stable compilers. //! #[auto_enum] -//! let _iter: impl Iterator = match x { +//! let iter: impl Iterator = match x { //! 0 => Some(0).into_iter(), //! _ => 0..x, //! }; @@ -853,7 +853,10 @@ #![no_std] #![doc(test( no_crate_inject, - attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code)) + attr( + deny(warnings, rust_2018_idioms, single_use_lifetimes), + allow(dead_code, unused_variables) + ) ))] #![forbid(unsafe_code)] #![warn(future_incompatible, rust_2018_idioms, single_use_lifetimes, unreachable_pub)] diff --git a/tests/doc/lib.rs b/tests/doc/lib.rs index 74067ccf..e8d86dcb 100644 --- a/tests/doc/lib.rs +++ b/tests/doc/lib.rs @@ -1,7 +1,10 @@ #![cfg(nightly)] #![doc(test( no_crate_inject, - attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code)) + attr( + deny(warnings, rust_2018_idioms, single_use_lifetimes), + allow(dead_code, unused_variables) + ) ))] #![cfg_attr(doctest, feature(external_doc))]