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
error: implementation of `sqlx::Decode` is not general enough
--> service/src/recommendations/recommend.rs:20:10
|
20 | #[derive(sqlx::Type)]
| ^^^^^^^^^^ implementation of `sqlx::Decode` is not general enough
|
= note: `std::string::String` must implement `sqlx::Decode<'0, sqlx::Postgres>`, for some specific lifetime `'0`...
= note: ...but it actually implements `sqlx::Decode<'r, sqlx::Postgres>`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
And I worked around it by changing the generated code:
Duplicate of #1031. This is a compiler bug (rust-lang/rust#82219). The bound for Option<String> is fine but in combination with the bound for String, the compiler gets confused.
With this dependency:
This code:
Generates this error:
And I worked around it by changing the generated code:
To this:
Note the change in lifetime
'r -> '_
and removal of context bounds.The text was updated successfully, but these errors were encountered: