Remove bool from cont_assert

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.
This commit is contained in:
Tobin C. Harding 2024-09-02 08:20:52 +10:00
parent af0c85c6e0
commit c71b23d81d
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 1 additions and 2 deletions

View File

@ -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
};
}
}