We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1242639 commit c46f185Copy full SHA for c46f185
src/librustc_data_structures/indexed_vec.rs
@@ -48,6 +48,13 @@ impl Idx for u32 {
48
fn index(self) -> usize { self as usize }
49
}
50
51
+/// Creates a struct type `S` that can be used as an index with
52
+/// `IndexVec` and so on. This struct can be constructed via `S::new`
53
+/// (given a `usize`) and converted to a usize with the `index()`
54
+/// method (from the `Idx` trait). Internally, the index uses a u32,
55
+/// so the index must not exceed `u32::MAX`. You can also customize
56
+/// things like the `Debug` impl, what traits are derived, and so
57
+/// forth.
58
#[macro_export]
59
macro_rules! newtype_index {
60
// ---- public rules ----
0 commit comments