-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Labels
C-enhancementCategory - New feature or requestCategory - New feature or requestC-performanceCategory - Solution not expected to change functional behavior, only performanceCategory - Solution not expected to change functional behavior, only performanceE-Help WantedExperience level - For the experienced collaboratorsExperience level - For the experienced collaborators
Description
we have these index types
oxc/crates/oxc_syntax/src/reference.rs
Lines 6 to 8 in 712ee0d
| define_index_type! { | |
| pub struct ReferenceId = u32; | |
| } |
oxc/crates/oxc_syntax/src/symbol.rs
Lines 7 to 9 in 712ee0d
| define_index_type! { | |
| pub struct SymbolId = u32; | |
| } |
where
oxc/crates/oxc_ast/src/ast/js.rs
Line 451 in 712ee0d
| pub reference_id: Cell<Option<ReferenceId>>, |
oxc/crates/oxc_semantic/src/reference.rs
Line 22 in 712ee0d
| symbol_id: Option<SymbolId>, |
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementCategory - New feature or requestCategory - New feature or requestC-performanceCategory - Solution not expected to change functional behavior, only performanceCategory - Solution not expected to change functional behavior, only performanceE-Help WantedExperience level - For the experienced collaboratorsExperience level - For the experienced collaborators
Type
Fields
Give feedbackPriority
None yet