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

Extend the lifetime in generated code. #506

Merged
merged 5 commits into from
Feb 12, 2024
Merged

Extend the lifetime in generated code. #506

merged 5 commits into from
Feb 12, 2024

Conversation

abizjak
Copy link
Member

@abizjak abizjak commented Jan 24, 2024

Purpose

Extend the lifetime in the generated code so that if the return value of the call has references that refer to host the generated code still compiles.

In particular this comes up in advanced cases where we have an entrypoint of a contract of the form

fn receive(...) -> Result<impl Serial, SomeError>

where the return value impl Serial would typically refer to either the host (via state if it is retrieving the state) or to the parameter.

This was discovered while prototyping Concordium/concordium-rust-smart-contracts#386

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

@abizjak abizjak requested a review from limemloh February 6, 2024 07:59
@abizjak abizjak merged commit e43fe4b into main Feb 12, 2024
67 checks passed
@abizjak abizjak deleted the extend-lifetime branch February 12, 2024 20:31
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.

None yet

2 participants