Skip to content

Commit d88cc2b

Browse files
committed
Use the rustc unknown lints attribute
The clippy unknown lints attribute was deprecated in nightly in rust-lang/rust#80524. The old lint name now produces a warning. Since we're using `allow(unknown_lints)` to suppress warnings, we need to add the canonical name, so we can continue to build without warnings on nightly. But we also need to keep the old name, so we can continue to build without warnings on stable. And therefore, we also need to disable the "removed lints" warning, otherwise we'll get warnings about the old name on nightly. We'll need to keep this transitional clippy config until rustc 1.51 is stable.
1 parent 3a093cc commit d88cc2b

File tree

7 files changed

+44
-4
lines changed

7 files changed

+44
-4
lines changed

zebra-chain/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
// #![deny(missing_docs)]
1010
#![allow(clippy::try_err)]
1111
// Disable some broken or unwanted clippy nightly lints
12+
// Build without warnings on nightly 2021-01-17 and later and stable 1.51 and later
13+
#![allow(unknown_lints)]
14+
// Disable old lint warnings on nightly until 1.51 is stable
15+
#![allow(renamed_and_removed_lints)]
16+
// Use the old lint name to build without warnings on stable until 1.51 is stable
1217
#![allow(clippy::unknown_clippy_lints)]
13-
#![allow(clippy::from_iter_instead_of_collect)]
14-
#![allow(clippy::unnecessary_wraps)]
18+
// The actual lints we want to disable
1519

1620
#[macro_use]
1721
extern crate serde;

zebra-consensus/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@
3737
//#![deny(missing_docs)]
3838
#![allow(clippy::try_err)]
3939
// Disable some broken or unwanted clippy nightly lints
40+
// Build without warnings on nightly 2021-01-17 and later and stable 1.51 and later
41+
#![allow(unknown_lints)]
42+
// Disable old lint warnings on nightly until 1.51 is stable
43+
#![allow(renamed_and_removed_lints)]
44+
// Use the old lint name to build without warnings on stable until 1.51 is stable
4045
#![allow(clippy::unknown_clippy_lints)]
46+
// The actual lints we want to disable
4147
#![allow(clippy::unnecessary_wraps)]
4248

4349
mod block;

zebra-network/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@
3939
// https://github.com/tokio-rs/tracing/issues/553
4040
#![allow(clippy::cognitive_complexity)]
4141
// Disable some broken or unwanted clippy nightly lints
42+
// Build without warnings on nightly 2021-01-17 and later and stable 1.51 and later
43+
#![allow(unknown_lints)]
44+
// Disable old lint warnings on nightly until 1.51 is stable
45+
#![allow(renamed_and_removed_lints)]
46+
// Use the old lint name to build without warnings on stable until 1.51 is stable
4247
#![allow(clippy::unknown_clippy_lints)]
48+
// The actual lints we want to disable
4349
#![allow(clippy::unnecessary_wraps)]
4450

4551
#[macro_use]

zebra-script/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
#![doc(html_logo_url = "https://www.zfnd.org/images/zebra-icon.png")]
44
#![doc(html_root_url = "https://doc.zebra.zfnd.org/zebra_script")]
55
// Disable some broken or unwanted clippy nightly lints
6+
// Build without warnings on nightly 2021-01-17 and later and stable 1.51 and later
7+
#![allow(unknown_lints)]
8+
// Disable old lint warnings on nightly until 1.51 is stable
9+
#![allow(renamed_and_removed_lints)]
10+
// Use the old lint name to build without warnings on stable until 1.51 is stable
611
#![allow(clippy::unknown_clippy_lints)]
12+
// The actual lints we want to disable
713
#![allow(clippy::unnecessary_wraps)]
814

915
use displaydoc::Display;

zebra-state/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
#![warn(missing_docs)]
77
#![allow(clippy::try_err)]
88
// Disable some broken or unwanted clippy nightly lints
9+
// Build without warnings on nightly 2021-01-17 and later and stable 1.51 and later
10+
#![allow(unknown_lints)]
11+
// Disable old lint warnings on nightly until 1.51 is stable
12+
#![allow(renamed_and_removed_lints)]
13+
// Use the old lint name to build without warnings on stable until 1.51 is stable
914
#![allow(clippy::unknown_clippy_lints)]
15+
// The actual lints we want to disable
1016
#![allow(clippy::field_reassign_with_default)]
1117
#![allow(clippy::unnecessary_wraps)]
1218

zebra-test/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
//! Miscellaneous test code for Zebra.
22
3+
// Each lazy_static variable uses additional recursion
4+
#![recursion_limit = "256"]
35
// Disable some broken or unwanted clippy nightly lints
6+
// Build without warnings on nightly 2021-01-17 and later and stable 1.51 and later
7+
#![allow(unknown_lints)]
8+
// Disable old lint warnings on nightly until 1.51 is stable
9+
#![allow(renamed_and_removed_lints)]
10+
// Use the old lint name to build without warnings on stable until 1.51 is stable
411
#![allow(clippy::unknown_clippy_lints)]
12+
// The actual lints we want to disable
513
#![allow(clippy::from_iter_instead_of_collect)]
6-
// Each lazy_static variable uses additional recursion
7-
#![recursion_limit = "256"]
814

915
use color_eyre::section::PanicMessage;
1016
use owo_colors::OwoColorize;

zebrad/tests/acceptance.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
#![allow(dead_code)]
1717
#![allow(clippy::try_err)]
1818
// Disable some broken or unwanted clippy nightly lints
19+
// Build without warnings on nightly 2021-01-17 and later and stable 1.51 and later
20+
#![allow(unknown_lints)]
21+
// Disable old lint warnings on nightly until 1.51 is stable
22+
#![allow(renamed_and_removed_lints)]
23+
// Use the old lint name to build without warnings on stable until 1.51 is stable
1924
#![allow(clippy::unknown_clippy_lints)]
25+
// The actual lints we want to disable
2026
#![allow(clippy::field_reassign_with_default)]
2127

2228
use color_eyre::eyre::Result;

0 commit comments

Comments
 (0)