we have these index types
https://github.com/oxc-project/oxc/blob/712ee0dde8e03d79513b42bad3b6736b566dd60b/crates/oxc_syntax/src/reference.rs#L6-L8
https://github.com/oxc-project/oxc/blob/712ee0dde8e03d79513b42bad3b6736b566dd60b/crates/oxc_syntax/src/symbol.rs#L7-L9
where
https://github.com/oxc-project/oxc/blob/712ee0dde8e03d79513b42bad3b6736b566dd60b/crates/oxc_ast/src/ast/js.rs#L451
https://github.com/oxc-project/oxc/blob/712ee0dde8e03d79513b42bad3b6736b566dd60b/crates/oxc_semantic/src/reference.rs#L22
can be trimmed by niche optimization.
But,
use std::num::NonZeroU32;
define_index_type! {
pub struct ReferenceId = NonZeroU32;
}
is not supported by the macro define_index_type
error[E0599]: no function or associated item named `max_value` found for struct `NonZero` in the current scope
--> crates/oxc_syntax/src/reference.rs:7:1
|
7 | / define_index_type! {
8 | | pub struct ReferenceId = NonZeroU32;
9 | | }
| |_^ function or associated item not found in `NonZero<u32>`
|
note: if you're trying to build a new `NonZero<u32>` consider using one of the following associated functions:
NonZero::<T>::new
NonZero::<T>::new_unchecked
--> /Users/boshen/.rustup/toolchains/1.78.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/num/nonzero.rs:308:5
but the good news is that we forked it and lives in https://github.com/oxc-project/oxc/tree/main/crates/oxc_index
The task of this issue is to make it work, if possible.
we have these index types
https://github.com/oxc-project/oxc/blob/712ee0dde8e03d79513b42bad3b6736b566dd60b/crates/oxc_syntax/src/reference.rs#L6-L8
https://github.com/oxc-project/oxc/blob/712ee0dde8e03d79513b42bad3b6736b566dd60b/crates/oxc_syntax/src/symbol.rs#L7-L9
where
https://github.com/oxc-project/oxc/blob/712ee0dde8e03d79513b42bad3b6736b566dd60b/crates/oxc_ast/src/ast/js.rs#L451
https://github.com/oxc-project/oxc/blob/712ee0dde8e03d79513b42bad3b6736b566dd60b/crates/oxc_semantic/src/reference.rs#L22
can be trimmed by niche optimization.
But,
is not supported by the macro
define_index_typebut the good news is that we forked it and lives in https://github.com/oxc-project/oxc/tree/main/crates/oxc_index
The task of this issue is to make it work, if possible.