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 may not live long enough error in SimpleObject macro #185

Closed
adzialocha opened this issue Jul 1, 2022 · 2 comments
Closed

lifetime may not live long enough error in SimpleObject macro #185

adzialocha opened this issue Jul 1, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@adzialocha
Copy link
Member

adzialocha commented Jul 1, 2022

Our CI "sometimes" fails with an undeterministic error in the SimpleObject macro of async-graphql@4.0.4 or Rust compiler:

error: lifetime may not live long enough
--> aquadoggo/src/graphql/client/response.rs:12:10
|
12| #[derive(SimpleObject, Serialize, Deserialize, Debug, Eq, PartialEq)]
| -^^^^^^^^^^^
| |
| let's call the lifetime of this reference `'2`
| let's call the lifetime of this reference `'1`
| associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
|
= note: this error originates in the derive macro `SimpleObject` (in Nightly builds, run with -Z macro-backtrace for more info)
error: lifetime may not live long enough
--> aquadoggo/src/graphql/client/response.rs:12:10
|
12| #[derive(SimpleObject, Serialize, Deserialize, Debug, Eq, PartialEq)]
| -^^^^^^^^^^^
| |
| let's call the lifetime of this reference `'1`
| let's call the lifetime of this reference `'2`
| associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
|
= note: this error originates in the derive macro `SimpleObject` (in Nightly builds, run with -Z macro-backtrace for more info)
error: could not compile `aquadoggo` due to 2 previous errors

Related issue: async-graphql/async-graphql#900

@adzialocha adzialocha changed the title Update async-graphql as soon as lifetime bug is fixed lifetime may not live long enough but in SimpleObject macro Jul 1, 2022
@adzialocha adzialocha changed the title lifetime may not live long enough but in SimpleObject macro lifetime may not live long enough error in SimpleObject macro Jul 1, 2022
@adzialocha adzialocha added the bug Something isn't working label Jul 1, 2022
@adzialocha
Copy link
Member Author

adzialocha commented Jul 1, 2022

Temporary workaround: cargo clean -p async-graphql -p aquadoggo

@adzialocha
Copy link
Member Author

This is fixed now in Rust 1.62.1 rust-lang/rust#98890

@adzialocha adzialocha self-assigned this Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant