You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ast_macros): raise compile error on invalid generate_derive input. (#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.
0 commit comments