Skip to content
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

WithOriginal and UsesTypeParams/UsesLifetimes #215

Open
nkovacs opened this issue Dec 12, 2022 · 1 comment
Open

WithOriginal and UsesTypeParams/UsesLifetimes #215

nkovacs opened this issue Dec 12, 2022 · 1 comment

Comments

@nkovacs
Copy link

nkovacs commented Dec 12, 2022

I had a data that looked like this:

data: ast::Data<darling::util::Ignored, MyField>,

and I implemented UsesTypeParams and UsesLifetimes for MyField, so I could use data.uses_type_params_cloned and everything was great.

Then I needed access to the original syn::Field, so I found WithOriginal, and changed my data to this:

data: ast::Data<darling::util::Ignored, WithOriginal<MyField, syn::Field>>,

but this broke data.uses_type_params_cloned (and uses_lifetimes_cloned) because WithOriginal does not implement these two traits.

Wouldn't it make sense for WithOriginal to forward these traits to the parsed type?

@TedDriggs
Copy link
Owner

Yes, that sounds reasonable to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants