Skip to content

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
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