Skip to content

fix: Remove redundant Box::pin calls from async code#106

Merged
benbrandt merged 1 commit intomainfrom
box-pin-fix
Apr 2, 2026
Merged

fix: Remove redundant Box::pin calls from async code#106
benbrandt merged 1 commit intomainfrom
box-pin-fix

Conversation

@benbrandt
Copy link
Copy Markdown
Member

Yesterday, Clippy complained a lot about large futures. I couldn't
figure out what the root cause was and just added them everywhere clippy
complained.

However, when adding to Zed I was getting stack overflows and was able
to trace it to the Builder::into_connection_and_future where the futures
with the connection were actually the root cause.

Adding Box::pin there means we can remove them from all of the
tests/examples/etc, which makes things look nice and beautiful again!

Yesterday, Clippy complained a lot about large futures. I couldn't
figure out what the root cause was and just added them everywhere clippy
complained.

However, when adding to Zed I was getting stack overflows and was able
to trace it to the Builder::into_connection_and_future where the futures
with the connection were actually the root cause.

Adding Box::pin there means we can remove them from all of the
tests/examples/etc, which makes things look nice and beautiful again!
@benbrandt benbrandt changed the title Remove redundant Box::pin calls from async code fix: Remove redundant Box::pin calls from async code Apr 2, 2026
};

crate::util::run_until(background, main_fn(connection.clone())).await
crate::util::run_until(Box::pin(background), Box::pin(main_fn(connection.clone())))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual problem 🎉

@benbrandt benbrandt merged commit 9fa32bb into main Apr 2, 2026
5 checks passed
@benbrandt benbrandt deleted the box-pin-fix branch April 2, 2026 12:10
@acp-release-bot acp-release-bot bot mentioned this pull request Apr 2, 2026
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.

1 participant