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

Lifetime issue with latest Rust nightly (1.64.0-nightly) #2004

Closed
kimpers opened this issue Jul 28, 2022 · 3 comments
Closed

Lifetime issue with latest Rust nightly (1.64.0-nightly) #2004

kimpers opened this issue Jul 28, 2022 · 3 comments
Labels
bug:rust Indicates a bug or regression in Rust

Comments

@kimpers
Copy link

kimpers commented Jul 28, 2022

Hi!

First of all thank you for maintaining an awesome library 🙏 I'm having some issues using SQLX (v0.6 or v0.5.12) with the latest Rust nightly version (1.64.0-nightly (2643b1646 2022-07-27).

After updating my Rust version I started getting these errors wherever I use the query* macros

error[E0107]: missing generics for trait `HasArguments`
   --> src/main.rs:64:25
    |
64  |       let rows_affected = sqlx::query!(
    |  _________________________^
65  | |         r#"
66  | | UPDATE todos
67  | | SET done = TRUE
...   |
70  | |         id
71  | |     )
    | |_____^ expected 1 lifetime argument
    |
note: trait defined here, with 1 lifetime parameter: `'q`
   --> /Users/X/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.6.0/src/database.rs:127:11
    |
127 | pub trait HasArguments<'q> {
    |           ^^^^^^^^^^^^ --
    = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query` (in Nightly builds, run with -Z macro-backtrace for more info)
help: add missing lifetime argument
   --> |/Users/X/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-0.6.0/src/macros.rs:304:9
    |
304 |         HasArguments<'q>

I created a minimal repro case using the sqlite example project at https://github.com/kimpers/sqlx-todos-example. If you try to build this with 1.64.0 it will fail with the above described issue.

Any ideas of how to fix this issue?

@kimpers kimpers changed the title Lifetime issue with latest Rust nightly (1.64.0-nightly (2643b1646 2022-07-27) Lifetime issue with latest Rust nightly (1.64.0-nightly) Jul 28, 2022
@abonander
Copy link
Collaborator

This seems like a regression that should be reported upstream.

@kimpers
Copy link
Author

kimpers commented Jul 31, 2022

This was reported upstream in rust-lang/rust#99949 and has been fixed in rust-lang/rust#99953. Keeping this issue open for informative purposes until the fix has been shipped

@abonander abonander added the bug:rust Indicates a bug or regression in Rust label Aug 2, 2022
@kimpers
Copy link
Author

kimpers commented Aug 7, 2022

This has now been fixed since Rust 1.64.0-nightly, closing the issue 🎉

@kimpers kimpers closed this as completed Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:rust Indicates a bug or regression in Rust
Projects
None yet
Development

No branches or pull requests

2 participants