Skip to content

Commit 7f09959

Browse files
authored
chore: use [lints] to address unexpected_cfgs lint (#7124)
1 parent fb7dec0 commit 7f09959

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+46
-55
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ freebsd_instance:
44
image_family: freebsd-14-1
55
env:
66
RUST_STABLE: stable
7-
RUST_NIGHTLY: nightly-2024-05-05
7+
RUST_NIGHTLY: nightly-2025-01-25
88
RUSTFLAGS: -D warnings
99

1010
# Test FreeBSD in a full VM on cirrus-ci.com. Test the i686 target too, in the

.github/workflows/ci.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ env:
1616
RUSTUP_WINDOWS_PATH_ADD_BIN: 1
1717
# Change to specific Rust release to pin
1818
rust_stable: stable
19-
rust_nightly: nightly-2024-05-05
19+
rust_nightly: nightly-2025-01-25
2020
# Pin a specific miri version
21-
rust_miri_nightly: nightly-2024-10-21
21+
rust_miri_nightly: nightly-2025-01-25
2222
rust_clippy: '1.77'
2323
# When updating this, also update:
2424
# - README.md
@@ -1086,23 +1086,6 @@ jobs:
10861086
run: cargo check-external-types --all-features
10871087
working-directory: tokio
10881088

1089-
check-unexpected-lints-cfgs:
1090-
name: check unexpected lints and cfgs
1091-
needs: basics
1092-
runs-on: ubuntu-latest
1093-
steps:
1094-
- uses: actions/checkout@v4
1095-
- name: Install Rust ${{ env.rust_nightly }}
1096-
uses: dtolnay/rust-toolchain@master
1097-
with:
1098-
toolchain: ${{ env.rust_nightly }}
1099-
- name: don't allow warnings
1100-
run: sed -i '/#!\[allow(unknown_lints, unexpected_cfgs)\]/d' */src/lib.rs */tests/*.rs
1101-
- name: check for unknown lints and cfgs
1102-
run: cargo check --all-features --tests
1103-
env:
1104-
RUSTFLAGS: -Dwarnings --check-cfg=cfg(loom,tokio_unstable,tokio_taskdump,fuzzing,mio_unsupported_force_poll_poll,tokio_internal_mt_counters,fs,tokio_no_parking_lot,tokio_no_tuning_tests) -Funexpected_cfgs -Funknown_lints
1105-
11061089
check-fuzzing:
11071090
name: check-fuzzing
11081091
needs: basics

Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ members = [
1717

1818
[workspace.metadata.spellcheck]
1919
config = "spellcheck.toml"
20+
21+
[workspace.lints.rust]
22+
unexpected_cfgs = { level = "warn", check-cfg = [
23+
'cfg(fuzzing)',
24+
'cfg(loom)',
25+
'cfg(mio_unsupported_force_poll_poll)',
26+
'cfg(tokio_internal_mt_counters)',
27+
'cfg(tokio_no_parking_lot)',
28+
'cfg(tokio_no_tuning_tests)',
29+
'cfg(tokio_taskdump)',
30+
'cfg(tokio_unstable)',
31+
] }

benches/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ harness = false
9595
name = "time_timeout"
9696
path = "time_timeout.rs"
9797
harness = false
98+
99+
[lints]
100+
workspace = true

examples/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ path = "named-pipe-multi-client.rs"
9595
[[example]]
9696
name = "dump"
9797
path = "dump.rs"
98+
99+
[lints]
100+
workspace = true

examples/dump.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(unknown_lints, unexpected_cfgs)]
2-
31
//! This example demonstrates tokio's experimental task dumping functionality.
42
//! This application deadlocks. Input CTRL+C to display traces of each task, or
53
//! input CTRL+C twice within 1 second to quit.

stress-test/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ tokio = { version = "1.0.0", path = "../tokio/", features = ["full"] }
1313

1414
[dev-dependencies]
1515
rand = "0.8"
16+
17+
[lints]
18+
workspace = true

tests-build/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ tokio = { version = "1.0.0", path = "../tokio", optional = true }
1515

1616
[dev-dependencies]
1717
trybuild = "1.0"
18+
19+
[lints]
20+
workspace = true

tests-integration/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ tokio-test = { version = "0.4", path = "../tokio-test", optional = true }
6161
doc-comment = "0.3.1"
6262
futures = { version = "0.3.0", features = ["async-await"] }
6363
bytes = "1.0.0"
64+
65+
[lints]
66+
workspace = true

tokio-macros/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ tokio = { version = "1.0.0", path = "../tokio", features = ["full"] }
3131

3232
[package.metadata.docs.rs]
3333
all-features = true
34+
35+
[lints]
36+
workspace = true

0 commit comments

Comments
 (0)