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:
parent
af0c85c6e0
commit
c71b23d81d
|
@ -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