mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-04 12:02:55 +00:00
utils: add const_assert! macro
This commit is contained in:
committed by
Egor Suvorov
parent
c9efdec8db
commit
c4b77084af
@@ -95,3 +95,11 @@ macro_rules! project_git_version {
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
/// Same as `assert!`, but evaluated during compilation and gets optimized out in runtime.
|
||||
#[macro_export]
|
||||
macro_rules! const_assert {
|
||||
($($args:tt)*) => {
|
||||
const _: () = assert!($($args)*);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user