-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide compile errors from #[ast]
macro
#124
Comments
rzvxa
referenced
this issue
in oxc-project/oxc
Aug 6, 2024
List inputs to the codegen explicitly. This is less DRY, but I think it has the advantage of being more obvious - for #4704.
rzvxa
changed the title
Provide compile errors from Aug 8, 2024
#[ast]
macro raise an error if file it's used in is not processed by AST codegen#[ast]
macro
rzvxa
referenced
this issue
in oxc-project/oxc
Aug 8, 2024
…ut. (#4766) It checks 2 things. 1) The input is a supported derive 2) The given identifier is the same as the fully qualified target trait. The latter makes sure that the trait for derive is included in the scope. Part of #4704 Here's an expanded example of how we assert traits: ```rust const _:() = { { trait AssertionTrait: ::oxc_allocator::CloneIn<'static> {} impl<T: CloneIn<'static>> AssertionTrait for T {} }; }; ``` It makes sure `CloneIn` is the same as `::oxc_allocator::CloneIn` and more importantly requires the user to include the trait if they wish to use it with `generate_derive`. It also provides LSP jump to definition.
Originally posted by @overlookmotel in #107 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#[ast]
attribute is not meaningful unless the type it's on is in a file which is processed by AST codegen.Make macro raise an error/panic if the file path needs to be added to AST codegen, with an error that says what to do. This will help people do the right thing.
generate_derive
(#4766)Span
and primitives don't meet our expectations#[ast]
attribute on types outside ofast_codegen
's viewThe text was updated successfully, but these errors were encountered: