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

Change the order of generic arguments for InsertValues #4050

Merged
merged 1 commit into from
May 31, 2024

Conversation

weiznich
Copy link
Member

This commit changes to order of generic arguments for the InsertValues trait. This allows us to generate a sound impl of that trait via #[derive(MultiConnection)] that will be accepted by future rust compiler versions as well. This works as the backend type is this case local, while the table type is generic. By having first the backend type and then the table type we first have the local type, which is allowed according to the rust coherence rules.

This is no breaking change as InsertValues is not part of the public API: https://docs.diesel.rs/2.1.x/diesel/index.html?search=insertvalues

This fixes #4035

@weiznich weiznich requested a review from a team May 28, 2024 11:08
@weiznich weiznich marked this pull request as ready for review May 28, 2024 11:08
This commit changes to order of generic arguments for the `InsertValues`
trait. This allows us to generate a sound impl of that trait via
`#[derive(MultiConnection)]` that will be accepted by future rust
compiler versions as well. This works as the backend type is this case
local, while the table type is generic. By having first the backend type
and then the table type we first have the local type, which is allowed
according to the rust coherence rules.

This is no breaking change as `InsertValues` is not part of the public
API: https://docs.diesel.rs/2.1.x/diesel/index.html?search=insertvalues

This fixes diesel-rs#4035
@weiznich weiznich added this pull request to the merge queue May 31, 2024
Merged via the queue into diesel-rs:master with commit df338ca May 31, 2024
49 checks passed
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.

Investigate new nightly warning about a soundness hole in the type system
3 participants