Closed
Description
We currently give the following output:
error[E0311]: the parameter type `T` may not live long enough
--> src/main.rs:25:11
|
25 | scope.spawn(move |_| {
| ^^^^^
|
note: the parameter type `T` must be valid for the anonymous lifetime #2 defined on the function body at 24:1...
--> src/main.rs:24:1
|
24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...so that the type `[closure@src/main.rs:25:17: 27:6]` will meet its required lifetime bounds
--> src/main.rs:25:11
|
25 | scope.spawn(move |_| {
| ^^^^^
help: consider introducing an explicit lifetime bound
|
24 | fn play_with<'a, T: 'a + Animal + Send>(scope: &Scope, animal: T) {
25 | scope.spawn + 'a(move |_| {
|
The suggestion has a spurious extra + 'a
in line 25 that shouldn't be there.