Skip to content

drop borrows just prior to calling task.return - #1125

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
dicej:better-borrow-dropping
Jan 15, 2025
Merged

alexcrichton merged 1 commit into
bytecodealliance:mainfrom
dicej:better-borrow-dropping

Conversation

@dicej

@dicej dicej commented Jan 15, 2025

Copy link
Copy Markdown
Collaborator

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 <joel.dice@fermyon.com>
@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
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