Skip to content

Conversation

@abizjak
Copy link
Contributor

@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
@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.

3 participants