Merge rust-bitcoin/rust-bitcoin#1420: Allow dead_code/unused_imports when fuzzing

5a2a37d4be Allow dead_code/unused_imports when fuzzing (Tobin C. Harding)

Pull request description:

  Littering the codebase with `#[cfg(not(fuzzing))]` is a bit messy just to quieten the linter during fuzzing. Instead just globally allow.

  Done while debugging #1409

ACKs for top commit:
  sanket1729:
    ACK 5a2a37d4be
  apoelstra:
    ACK 5a2a37d4be

Tree-SHA512: fb84215a2b00ad6d3321b2781ba285af513ff8fd413c0997045a41c4f23028d2ef0fdf083839289d0c5108c990aa66bdae4430ad3ef32881eac5324b2e881b3b
This commit is contained in:
Andrew Poelstra 2022-12-30 14:43:04 +00:00
commit 4d7b8cd3b4
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
2 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,9 @@
#![deny(missing_docs)] #![deny(missing_docs)]
#![deny(unused_must_use)] #![deny(unused_must_use)]
// Instead of littering the codebase for non-fuzzing code just globally allow.
#![cfg_attr(fuzzing, allow(dead_code, unused_imports))]
#[cfg(not(any(feature = "std", feature = "no-std")))] #[cfg(not(any(feature = "std", feature = "no-std")))]
compile_error!("at least one of the `std` or `no-std` features must be enabled"); compile_error!("at least one of the `std` or `no-std` features must be enabled");

View File

@ -96,6 +96,9 @@
#![cfg_attr(all(not(test), not(feature = "std")), no_std)] #![cfg_attr(all(not(test), not(feature = "std")), no_std)]
// Instead of littering the codebase for non-fuzzing code just globally allow.
#![cfg_attr(fuzzing, allow(dead_code, unused_imports))]
#[cfg(bench)] extern crate test; #[cfg(bench)] extern crate test;
#[cfg(any(test, feature = "std"))] extern crate core; #[cfg(any(test, feature = "std"))] extern crate core;
#[cfg(feature = "core2")] extern crate core2; #[cfg(feature = "core2")] extern crate core2;