refactor(ast): use type identifier instead of CloneIn::Cloned GAT. (#4738)

After https://github.com/oxc-project/oxc/pull/4731#discussion_r1707526289, I realized that I'm using `Self::Cloned` for enum derives. It was from my earlier attempts to resolve lifetime issues.
This commit is contained in:
rzvxa 2024-08-07 21:23:23 +00:00
parent 51c1ca02d3
commit 579b797cc5
2 changed files with 800 additions and 662 deletions

File diff suppressed because it is too large Load diff

View file

@ -59,10 +59,10 @@ fn derive_enum(def: &EnumDef) -> TokenStream {
.map(|var| {
let ident = var.ident();
if var.is_unit() {
quote!(Self :: #ident => Self :: Cloned :: #ident)
quote!(Self :: #ident => #ty_ident :: #ident)
} else {
used_alloc = true;
quote!(Self :: #ident(it) => Self :: Cloned :: #ident(it.clone_in(alloc)))
quote!(Self :: #ident(it) => #ty_ident :: #ident(it.clone_in(alloc)))
}
})
.collect_vec();