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

Demand lifetimes for pgrx::composite_type! #1462

Conversation

workingjubilee
Copy link
Member

The pgrx::composite_type! macro currently assigns the 'static lifetime if you do not give one. This is a decision of dubious soundness. Instead, demand a lifetime, or assign the anonymous lifetime. Both cases match the behavior of attempting to elide lifetimes in your usual Rust code, though with slightly worse error messages in some cases. This may require people to write 'static in more places (and that is what the typical error suggests), but it allows noticing and fixing problems that currently are not visible, easy to understand, or easy to check.

This is the latest in this series:

@workingjubilee workingjubilee merged commit 684b4c3 into pgcentralfoundation:develop Jan 5, 2024
8 checks passed
@workingjubilee workingjubilee deleted the composite-some-better-lifetimes branch January 5, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant