Skip to content

Commit

Permalink
Merge #685: Allow unexpected_cfgs
Browse files Browse the repository at this point in the history
ed869d7 Allow unexpected_cfgs (Tobin C. Harding)
bea260d Use rustfmt::skip instead of cfg_attr (Tobin C. Harding)

Pull request description:

  Rust `nightly` just introduced a new lint that breaks us, disable it.

  Same as rust-bitcoin/rust-bitcoin#2748

  Please see 2748 for full description of the issue this resolves.

  Note, the first patch uses `rustfmt::skip` instead of `cfg_attr` to save triggering the lint in example code.

ACKs for top commit:
  apoelstra:
    ACK ed869d7

Tree-SHA512: 9c158fa90eca8973ec8afec4b1bc334bce78bc6735ed945d40c36efb21f2728ea2b3c9179a5ee3e5638340be80a8ae49ae460ad1b13915d6cebcc2f9fcd1a538
  • Loading branch information
apoelstra committed May 8, 2024
2 parents 4590488 + ed869d7 commit 15ddc86
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/sign_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ fn spending_transaction() -> bitcoin::Transaction {
}
}

#[rustfmt::skip]
fn list_of_three_arbitrary_public_keys() -> Vec<bitcoin::PublicKey> {
#[cfg_attr(feature="cargo-fmt", rustfmt_skip)]
vec![
bitcoin::PublicKey::from_slice(&[2; 33]).expect("key 1"),
bitcoin::PublicKey::from_slice(&[
Expand Down
2 changes: 1 addition & 1 deletion examples/verify_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ fn main() {
}

/// Returns an arbitrary transaction.
#[rustfmt::skip]
fn hard_coded_transaction() -> bitcoin::Transaction {
// tx `f27eba163c38ad3f34971198687a3f1882b7ec818599ffe469a8440d82261c98`
#[cfg_attr(feature="cargo-fmt", rustfmt_skip)]
let tx_bytes = vec![
0x01, 0x00, 0x00, 0x00, 0x02, 0xc5, 0x11, 0x1d, 0xb7, 0x93, 0x50, 0xc1,
0x70, 0x28, 0x41, 0x39, 0xe8, 0xe3, 0x4e, 0xb0, 0xed, 0xba, 0x64, 0x7b,
Expand Down
2 changes: 2 additions & 0 deletions fuzz/fuzz_targets/compile_descriptor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)]

use std::str::FromStr;

use honggfuzz::fuzz;
Expand Down
2 changes: 2 additions & 0 deletions fuzz/fuzz_targets/parse_descriptor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)]

use std::str::FromStr;

use honggfuzz::fuzz;
Expand Down
2 changes: 2 additions & 0 deletions fuzz/fuzz_targets/parse_descriptor_secret.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)]

use std::str::FromStr;

use honggfuzz::fuzz;
Expand Down
2 changes: 2 additions & 0 deletions fuzz/fuzz_targets/roundtrip_concrete.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)]

use std::str::FromStr;

use honggfuzz::fuzz;
Expand Down
2 changes: 2 additions & 0 deletions fuzz/fuzz_targets/roundtrip_descriptor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)]

use std::str::FromStr;

use honggfuzz::fuzz;
Expand Down
2 changes: 2 additions & 0 deletions fuzz/fuzz_targets/roundtrip_miniscript_script.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)]

use honggfuzz::fuzz;
use miniscript::bitcoin::blockdata::script;
use miniscript::{Miniscript, Segwitv0};
Expand Down
2 changes: 2 additions & 0 deletions fuzz/fuzz_targets/roundtrip_miniscript_str.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)]

use std::str::FromStr;

use honggfuzz::fuzz;
Expand Down
2 changes: 2 additions & 0 deletions fuzz/fuzz_targets/roundtrip_semantic.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)]

use std::str::FromStr;

use honggfuzz::fuzz;
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
// Clippy lints that we have disabled
#![allow(clippy::iter_kv_map)] // https://github.com/rust-lang/rust-clippy/issues/11752
#![allow(clippy::manual_range_contains)] // I hate this lint -asp
#![allow(unexpected_cfgs)] // This one is just batshit.

#[cfg(target_pointer_width = "16")]
compile_error!(
Expand Down

0 comments on commit 15ddc86

Please sign in to comment.