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
structBar{foo: tokio::sync::OnceCell<Foo>,}implBar{pubasyncfnfoo(&self,conn:&DatabaseConnection) -> Result<&Foo,Error>{self.foo.get_or_try_init(|| async{// Do something with conn to retrieve Foo from DB}).await}}
Sometimes it gives an error like:
associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`rustc
mod.rs(87, 15): let's call the lifetime of this reference `'2`
mod.rs(86, 9): let's call the lifetime of this reference `'1`
lifetime may not live long enough
associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`rustc
mod.rs(86, 9): let's call the lifetime of this reference `'1`
mod.rs(87, 15): let's call the lifetime of this reference `'2`
cargo check doesn't complains about it, in facts code builds and run correctly.
I've also tried to satisfy RA requests, like that:
implBar{pubasyncfnfoo<'a>(&'a self,conn:&DatabaseConnection) -> Result<&'a Foo,Error>{self.foo.get_or_try_init(|| async{// Do something with conn to retrieve Foo from DB}).await}}
Sometimes it gives an error like:
associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`rustc
mod.rs(87, 15): let's call the lifetime of this reference `'1`
mod.rs(85, 30): lifetime `'a` defined here
lifetime may not live long enough
associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`rustc
mod.rs(85, 30): lifetime `'a` defined here
mod.rs(87, 15): let's call the lifetime of this reference `'1`
Sometimes I save the file and got no errors at all...
The text was updated successfully, but these errors were encountered:
rust-analyzer version: v0.3.1115
rustc version: 1.62.0 (a8314ef7d 2022-06-27)
relevant settings: none
Randomly RA signals as error a method like:
Sometimes it gives an error like:
cargo check doesn't complains about it, in facts code builds and run correctly.
I've also tried to satisfy RA requests, like that:
Sometimes it gives an error like:
Sometimes I save the file and got no errors at all...
The text was updated successfully, but these errors were encountered: