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[E0597]: `thing` does not live long enough
--> src/main.rs:12:14
|
10 | async fn foo(&self, call: &(dyn (Fn(&String) -> bool) + Sync)) {
| ---- lifetime `'1` appears in the type of `call`
11 | let thing = "a".to_string();
| ----- binding `thing` declared here
12 | call(&thing);
| -----^^^^^^-
| | |
| | borrowed value does not live long enough
| argument requires that `thing` is borrowed for `'1`
13 | }
| - `thing` dropped here while still borrowed
Manually removing 'life2 makes the code compile.
The text was updated successfully, but these errors were encountered:
On latest
async-trait
(0.1.77) this code doesn't compile:This expands to:
And gives the compiler error:
Manually removing
'life2
makes the code compile.The text was updated successfully, but these errors were encountered: