You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A connection-like type is required to execute the call. Allowed types include PgConnection, PoolConnection and Transaction, as well as mutable references to any of these.
Neither Transaction<Postgres> nor PgConnection implement the required AsMut<PgConnection> trait.
error[E0277]: the trait bound `PgConnection:AsMut<PgConnection>` is not satisfied
--> src/repositories/deposit/queries.rs:640:12
|
640 | lock1:PgAdvisoryLockGuard<'l,PgConnection>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsMut<PgConnection>` is not implemented for `PgConnection`
|
note: required by a bound in `PgAdvisoryLockGuard`
--> /Users/conrad.ludgate/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-0.6.3/src/postgres/advisory_lock.rs:80:42
|
80 | pub struct PgAdvisoryLockGuard<'lock,C:AsMut<PgConnection>> {
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `PgAdvisoryLockGuard`
error[E0277]: the trait bound `Transaction<'_,Postgres>:AsMut<PgConnection>` is not satisfied
--> src/repositories/deposit/queries.rs:641:12
|
641 | lock2:PgAdvisoryLockGuard<'l,Transaction<Postgres>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsMut<PgConnection>` is not implemented for `Transaction<'_,Postgres>`
|
note: required by a bound in `PgAdvisoryLockGuard`
--> /Users/conrad.ludgate/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-0.6.3/src/postgres/advisory_lock.rs:80:42
|
80 | pub struct PgAdvisoryLockGuard<'lock,C:AsMut<PgConnection>> {
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `PgAdvisoryLockGuard`
Info
SQLx version: 0.6.3
SQLx features enabled:
"chrono",
"offline",
"postgres",
"runtime-tokio-native-tls",
"macros",
"migrate",
"uuid",
"json",
"bigdecimal",
Database server and version: Postgres
Operating system: MacOS
rustc --version: 1.69.0
The text was updated successfully, but these errors were encountered:
The documentation for `PgAdvisoryLockGuard` lists a set of types
that should be able to be passed to it, but when actually trying
to do so, compilation would fail due to missing `AsMut` trait
implementations for those types. This commit adds the missing
`AsMut` impls so that `Transaction` and `PgConnection` can be used
as type parameters to `PgAdvisoryLockGuard`, as expected.
For reference: #2520
Bug Description
https://docs.rs/sqlx/0.6.3/sqlx/postgres/struct.PgAdvisoryLock.html#method.acquire
Neither
Transaction<Postgres>
norPgConnection
implement the requiredAsMut<PgConnection>
trait.Minimal Reproduction
Info
rustc --version
: 1.69.0The text was updated successfully, but these errors were encountered: