1
Fork 0

Make #[max] an attribute in newtype_index

This commit is contained in:
Nilstrieb 2022-12-18 21:22:14 +01:00
parent 93429948cf
commit 91c3c2040c
4 changed files with 21 additions and 17 deletions

View file

@ -3,7 +3,10 @@
// Allows the macro invocation below to work
use crate as rustc_index;
rustc_macros::newtype_index!(struct MyIdx { MAX = 0xFFFF_FFFA });
rustc_macros::newtype_index! {
#[max = 0xFFFF_FFFA]
struct MyIdx { }
}
#[test]
fn index_size_is_optimized() {