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