Skip to content

Commit

Permalink
Re-enable "unexpected_cfgs" lint
Browse files Browse the repository at this point in the history
Previously, this lint was disabled because
it would not accept custom cfg values unless
a build.rs was added (which is undesirable).

Now, reachable cfgs can be configured from
Cargo.toml, so this is what we should do.
  • Loading branch information
simonwuelker authored and faern committed May 25, 2024
1 parent 879b8c7 commit f2846be
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ criterion = "0.3"
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "time"] }
async-std = { version = "1", features = ["attributes"] }

[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(loom)', 'cfg(oneshot_test_delay)'] }

[[bench]]
name = "benches"
harness = false
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
// [1]: Mind that the waker only takes zero bytes when all features are disabled, making it
// impossible to *wait* for the message. `try_recv` the only available method in this scenario.

#![allow(unexpected_cfgs)]
#![deny(rust_2018_idioms)]
#![cfg_attr(not(feature = "std"), no_std)]

Expand Down
1 change: 0 additions & 1 deletion tests/async.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(unexpected_cfgs)]
#![cfg(all(feature = "async", not(loom)))]

use core::mem;
Expand Down
1 change: 0 additions & 1 deletion tests/future.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg(feature = "async")]
#![allow(unexpected_cfgs)]

use core::{future, mem, pin, task};

Expand Down
1 change: 0 additions & 1 deletion tests/loom.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(unexpected_cfgs)]
#![cfg(loom)]

use oneshot::TryRecvError;
Expand Down
1 change: 0 additions & 1 deletion tests/raw.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(unexpected_cfgs)]
#![cfg(not(loom))]

use oneshot::{channel, Receiver, Sender};
Expand Down
2 changes: 0 additions & 2 deletions tests/sync.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(unexpected_cfgs)]

use core::mem;
use oneshot::TryRecvError;

Expand Down

0 comments on commit f2846be

Please sign in to comment.