]> git.lizzy.rs Git - rust.git/blob - src/librustc_data_structures/macros.rs
Auto merge of #58879 - spastorino:update_miri, r=oli-obk
[rust.git] / src / librustc_data_structures / macros.rs
1 /// A simple static assertion macro. The first argument should be a unique
2 /// ALL_CAPS identifier that describes the condition.
3 #[macro_export]
4 #[allow_internal_unstable(type_ascription)]
5 macro_rules! static_assert {
6     ($name:ident: $test:expr) => {
7         // Use the bool to access an array such that if the bool is false, the access
8         // is out-of-bounds.
9         #[allow(dead_code)]
10         static $name: () = [()][!($test: bool) as usize];
11     }
12 }