Merge rust-bitcoin/rust-bitcoin#2312: Add allow for out of bounds indexing

278229def5 Add allow for out of bounds indexing (yancy)

Pull request description:

  Out of bounds indexing is a workaround for const panic until MSRV +1.57

ACKs for top commit:
  apoelstra:
    ACK 278229def5 Happy New Year! Will merge based on CI one-ack carveout.

Tree-SHA512: 5d525b682c28407e910ae45e8999fe6c95226d5079db917ccda296c68d4ed7a204c9ff1c5ea36d0ae647ee605780939028bf04a3948b1034c71e88cf6f03c782
This commit is contained in:
Andrew Poelstra 2024-01-02 15:38:03 +00:00
commit 26195570d9
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
2 changed files with 4 additions and 0 deletions

View File

@ -67,6 +67,8 @@ impl Weight {
#[allow(unconditional_panic)]
// disabling this lint until panic!() can be used.
#[allow(clippy::let_unit_value)]
// disabling this lint until panic!() can be used.
#[allow(clippy::out_of_bounds_indexing)]
let _int_overflow_scaling_weight = [(); 0][1];
Weight(0)
}

View File

@ -594,6 +594,8 @@ impl Amount {
#[allow(unconditional_panic)]
// disabling this lint until panic!() can be used.
#[allow(clippy::let_unit_value)]
// disabling this lint until panic!() can be used.
#[allow(clippy::out_of_bounds_indexing)]
let _int_overflow_converting_btc_to_sats = [(); 0][1];
Amount(0)
}