Skip to content

Commit

Permalink
Allow unused_variables lint in doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 5, 2021
1 parent e00e4c0 commit 64241ee
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
5 changes: 4 additions & 1 deletion core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
5 changes: 4 additions & 1 deletion derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = i32> = match x {
//! let iter: impl Iterator<Item = i32> = match x {
//! 0 => Some(0).into_iter(),
//! _ => 0..x,
//! };
Expand Down Expand Up @@ -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)]
Expand Down
5 changes: 4 additions & 1 deletion tests/doc/lib.rs
Original file line number Diff line number Diff line change
@@ -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))]

Expand Down

0 comments on commit 64241ee

Please sign in to comment.