1#![cfg_attr(all(feature = "nightly", test), feature(stmt_expr_attributes))]
3#![cfg_attr(feature = "nightly", feature(extend_one, step_trait, test))]
4#![cfg_attr(feature = "nightly", feature(new_range_api))]
5pub mod bit_set;
8#[cfg(feature = "nightly")]
9pub mod interval;
10
11mod idx;
12mod slice;
13mod vec;
14
15pub use idx::{Idx, IntoSliceIdx};
16pub use rustc_index_macros::newtype_index;
17pub use slice::IndexSlice;
18#[doc(no_inline)]
19pub use vec::IndexVec;
20
21#[macro_export]
35#[cfg(not(feature = "rustc_randomized_layouts"))]
36macro_rules! static_assert_size {
37 ($ty:ty, $size:expr) => {
38 const _: [(); $size] = [(); ::std::mem::size_of::<$ty>()];
39 };
40}
41
42#[macro_export]
43#[cfg(feature = "rustc_randomized_layouts")]
44macro_rules! static_assert_size {
45 ($ty:ty, $size:expr) => {
46 const _: (usize, usize) = ($size, ::std::mem::size_of::<$ty>());
49 };
50}
51
52#[macro_export]
53macro_rules! indexvec {
54 ($expr:expr; $n:expr) => {
55 IndexVec::from_raw(vec![$expr; $n])
56 };
57 ($($expr:expr),* $(,)?) => {
58 IndexVec::from_raw(vec![$($expr),*])
59 };
60}