Merge rust-bitcoin/rust-bitcoin#3280: Remove bool from const_assert

c71b23d81d Remove bool from cont_assert (Tobin C. Harding)

Pull request description:

  It was correctly pointed out during review of #3215 (when we made `const_assert` panic) that using a `bool` added no additional information.

  Remove the `bool` and just use unit.

ACKs for top commit:
  apoelstra:
    ACK c71b23d81d successfully ran local tests; lol sure
  Kixunil:
    ACK c71b23d81d

Tree-SHA512: be9f4f10ee7d626a082b7ae9f257b79d500824ed3c1f7327391b2ad4d67e60d7da47a14fa7ef8f99d1ea8157967b4658518cbcf1c1bfcf1d8888455f3eb96437
This commit is contained in:
merge-script 2024-09-02 15:40:23 +00:00
commit 6301272643
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 1 additions and 2 deletions

View File

@ -140,12 +140,11 @@ macro_rules! debug_from_display {
#[macro_export] #[macro_export]
macro_rules! const_assert { macro_rules! const_assert {
($x:expr $(; $message:expr)?) => { ($x:expr $(; $message:expr)?) => {
const _: bool = { const _: () = {
if !$x { if !$x {
// We can't use formatting in const, only concating literals. // We can't use formatting in const, only concating literals.
panic!(concat!("assertion ", stringify!($x), " failed" $(, ": ", $message)?)) panic!(concat!("assertion ", stringify!($x), " failed" $(, ": ", $message)?))
} }
$x
}; };
} }
} }