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

drop borrows just prior to calling task.return #1125

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

dicej
Copy link
Collaborator

@dicej dicej commented Jan 15, 2025

Prior to #1124, we were dropping borrows too late. That PR fixed that problem, but dropped borrows too early and didn't allow application code to capture the borrows in the Future it returned. This patch improves the situation by dropping borrows as late as possible, but no later. As a side effect, it simplfies the code and makes implementing the generated trait(s) much more ergonomic.

Prior to bytecodealliance#1124, we were dropping borrows too late.  That PR fixed that problem,
but dropped borrows too early and didn't allow application code to capture the
borrows in the `Future` it returned.  This patch improves the situation by
dropping borrows as late as possible, but no later.  As a side effect, it
simplfies the code and makes implementing the generated trait(s) much more
ergonomic.

Signed-off-by: Joel Dice <[email protected]>
@dicej dicej requested a review from alexcrichton January 15, 2025 15:16
@alexcrichton alexcrichton added this pull request to the merge queue Jan 15, 2025
Merged via the queue into bytecodealliance:main with commit 4f4a953 Jan 15, 2025
25 checks passed
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