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: ACKc71b23d81d
successfully ran local tests; lol sure Kixunil: ACKc71b23d81d
Tree-SHA512: be9f4f10ee7d626a082b7ae9f257b79d500824ed3c1f7327391b2ad4d67e60d7da47a14fa7ef8f99d1ea8157967b4658518cbcf1c1bfcf1d8888455f3eb96437
This commit is contained in:
commit
6301272643
|
@ -140,12 +140,11 @@ macro_rules! debug_from_display {
|
|||
#[macro_export]
|
||||
macro_rules! const_assert {
|
||||
($x:expr $(; $message:expr)?) => {
|
||||
const _: bool = {
|
||||
const _: () = {
|
||||
if !$x {
|
||||
// We can't use formatting in const, only concating literals.
|
||||
panic!(concat!("assertion ", stringify!($x), " failed" $(, ": ", $message)?))
|
||||
}
|
||||
$x
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue