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

Support conditional derives / custom attributes #2520

Closed
Crzyrndm opened this issue May 5, 2023 · 2 comments · Fixed by #2866
Closed

Support conditional derives / custom attributes #2520

Crzyrndm opened this issue May 5, 2023 · 2 comments · Fixed by #2866

Comments

@Crzyrndm
Copy link

Crzyrndm commented May 5, 2023

As far as I can tell, #1089 was resolved by the ability to add custom derives. The support for more custom attributes beyond just listing derives wasn't part of the resolution.

I have a case where the derive needs to be conditional (cfg_attr(feature = "feat1", derive(MyDerive))) and the bindings are not being generated from the build script (in this case: to reduce build system dependencies). I have a workaround generating a set of bindings for each combination of conditions but this

  • is unwieldy / awkward
  • only works for derives and I have at least one case where I need to manually add an attribute currently

It would be appreciated if ParseCallbacks::add_derives could be extended to a more general ParseCallbacks::add_attributes

@pvdrz
Copy link
Contributor

pvdrz commented May 5, 2023

This would also fix #2513

@mkroening
Copy link
Contributor

mkroening commented Jul 8, 2024

I have just opened #2866. :)

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

Successfully merging a pull request may close this issue.

3 participants