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

Remove unnecessary boxfutures #3525

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

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 2 times, most recently from 095c5b4 to 5e59a2a Compare October 7, 2024 18:53
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