-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
PoolOptions<DB> can't be cloned #2548
Labels
Comments
I believe, looking through the source, that |
abonander
pushed a commit
that referenced
this issue
Jul 9, 2023
* Implement Clone for PoolOptions manually (#2548) Trying to derive `Clone` automatically for `PoolOptions` results in errors when `clone` is actually called. This is because the derive incorrectly determines that `Clone` is _not_ derivable due to the lack of `Clone` implementation on the `DB: Database` type parameter, even though no value of that type is actually stored in a to-be-cloned position (in fact, it's only used for the `Connection` associated type on the type parameter's `Database` trait impl). Manually implementing `Clone` side-steps this issue and insures the type is always actually cloneable. For reference: #2548 * Ran 'cargo fmt' * Simplified Arc cloning
Closed by #2553 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
Despite the #[derive(Clone)] on PoolOptions in sqlx-core, PoolOptions cannot be cloned due to unsatisfied trait bounds on the database and database connection types.
Minimal Reproduction
Info
rustc --version
:The text was updated successfully, but these errors were encountered: