Skip to content

Remove unnecessary boxfutures#3525

Merged
abonander merged 7 commits intolaunchbadge:mainfrom
joeydewaal:remove_boxfutures
Jul 5, 2025
Merged

Remove unnecessary boxfutures#3525
abonander merged 7 commits intolaunchbadge:mainfrom
joeydewaal:remove_boxfutures

Conversation

@joeydewaal
Copy link
Contributor

@joeydewaal joeydewaal commented Sep 26, 2024

This is a breaking change

This pr removes unnecessary BoxFuture's in trait definitions Connection, MigrateDatabase, TransactionManager, ConnectOptions, TestSupport and PgPoolCopyExt.

I was not able to make these changes to the Executor and Acquire traits unfortunately because of a rustc limitation.

error: lifetime bound not satisfied
   |
38 | /     async fn fetch_optional<'e, 'q: 'e, E>(
39 | |         self,
40 | |         query: E,
41 | |     ) -> Result<Option<DB::Row>, Error>
42 | |     where
43 | |         E: 'q + Execute<'q, Self::Database>,
   | |____________________________________________^
   |
   = note: this is a known limitation that will be removed in the future (see issue #100013 <https://github.com/rust-lang/rust/issues/100013> for more information)

@joeydewaal joeydewaal marked this pull request as draft September 26, 2024 09:44
@joeydewaal
Copy link
Contributor Author

It seems like the stack is overflowing in debug mode, in release mode the tests pass.

@joeydewaal joeydewaal marked this pull request as ready for review September 26, 2024 11:06
@abonander
Copy link
Collaborator

We probably need to do the same thing to PgConnection as was done to MySqlConnection and wrap the fields in a Box, then it'll be less to pass around.

@abonander
Copy link
Collaborator

The Executor and Acquire traits likely require reworking anyway. I'll get to that at some point soon.

@abonander abonander added this to the 0.9.0 milestone Sep 28, 2024
@joeydewaal
Copy link
Contributor Author

We probably need to do the same thing to PgConnection as was done to MySqlConnection and wrap the fields in a Box, then it'll be less to pass around.

I opened a new pr for this (#3529)

@joeydewaal joeydewaal force-pushed the remove_boxfutures branch 3 times, most recently from 95f6986 to 257d869 Compare October 9, 2024 20:15
@joeydewaal joeydewaal force-pushed the remove_boxfutures branch from 00cff28 to eca26ad Compare July 2, 2025 08:47
@abonander abonander merged commit 0f891a3 into launchbadge:main Jul 5, 2025
84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants