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

Let bindgen know which traits Datum implements #725

Merged
merged 1 commit into from
Sep 30, 2022
Merged

Let bindgen know which traits Datum implements #725

merged 1 commit into from
Sep 30, 2022

Conversation

JamesGuthrie
Copy link
Contributor

In #545 we replaced Datum's autogenerated bindings with an opaque pointer. Because bindgen was not generating the type, it could not know which traits Datum implements. This changed how containers of Datum were emitted. In particular containers of Datum no longer derived Debug, Copy, or Clone. This also affected how unions containing these containers were emitted: bindgen only uses Rust unions if all members are Copy, falling back to a struct of __BindgenUnionField<_> fields otherwise.

This change tells bindgen which traits our Datum implementation implements, fixing all of the above issues.

@JamesGuthrie JamesGuthrie changed the title Tell bindgen about datum traits Let bindgen know which traits Datum implements Sep 30, 2022
@JamesGuthrie
Copy link
Contributor Author

FYI apparently bindgen only supports calling .parse_callbacks() once.

@workingjubilee workingjubilee mentioned this pull request Sep 30, 2022
7 tasks
In #545 we replaced `Datum`'s autogenerated bindings with an opaque
pointer. Because bindgen was not generating the type, it could not know
which traits `Datum` implements. This changed how containers of `Datum`
were emitted. In particular containers of `Datum` no longer derived
`Debug`, `Copy`, or `Clone`. This also affected how unions containing
these containers were emitted: bindgen only uses Rust unions if all
members are `Copy`, falling back to a struct of `__BindgenUnionField<_>`
fields otherwise.

This change tells bindgen which traits our `Datum` implementation
implements, fixing all of the above issues.
Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@workingjubilee workingjubilee merged commit d110975 into pgcentralfoundation:develop Sep 30, 2022
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 this pull request may close these issues.

2 participants