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
The code below does not compile on nightly-2024-04-05 or later.
Minimal Reproduction
use sqlx::Type;#[derive(Type)]structFoo{a:i32,}fnmain(){}
error: lifetime may not live long enough
--> src/main.rs:3:10
|
3 | #[derive(Type)]
| ^^^^
| |
| lifetime `'r` defined here
| requires that `'r` must outlive `'static`
| in this derive macro expansion
|
::: /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.7.4/src/lib.rs:43:1
|
43 | pub fn derive_type(tokenstream:TokenStream) -> TokenStream{
| ----------------------------------------------------------- in this expansion of `#[derive(Type)]`
|
note: due to current limitations in the borrow checker, this implies a `'static` lifetime
--> /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-postgres-0.7.4/src/types/record.rs:97:12
|
97 | T:for<'a> Decode<'a,Postgres> + Type<Postgres>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of `sqlx::Decode` is not general enough
--> src/main.rs:3:10
|
3 | #[derive(Type)]
| ^^^^
| |
| implementation of `sqlx::Decode` is not general enough
| in this derive macro expansion
|
::: /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.7.4/src/lib.rs:43:1
|
43 | pub fn derive_type(tokenstream:TokenStream) -> TokenStream{
| ----------------------------------------------------------- in this expansion of `#[derive(Type)]`
|
= note: `i32` must implement `sqlx::Decode<'0,Postgres>`,for any lifetime `'0`...
= note: ...but it actually implements `sqlx::Decode<'1,Postgres>`,for some specific lifetime `'1`
error: could not compile `testing` (bin "testing") due to 2 previous errors
Info
SQLx version: sqlx = { version = "0.7.4", features = ["postgres"] }
Database server and version: psql (PostgreSQL) 16.2 (Ubuntu 16.2-1.pgdg20.04+1)
Operating system: Linux Mint 20.1 x86_64
rustc --version: nightly-2024-04-05
The text was updated successfully, but these errors were encountered:
I'm also seeing this. On the plus side, I learned how to downgrade a rust version from this. If you're here and need to do the same, here's how...
# Install the version before the broken one.
rustup install nightly-2024-04-04
# Set the version to the installed one
rustup override set nightly-2024-04-04
Bug Description
The code below does not compile on nightly-2024-04-05 or later.
Minimal Reproduction
Info
sqlx = { version = "0.7.4", features = ["postgres"] }
psql (PostgreSQL) 16.2 (Ubuntu 16.2-1.pgdg20.04+1)
Linux Mint 20.1 x86_64
rustc --version
: nightly-2024-04-05The text was updated successfully, but these errors were encountered: