Skip to content

Commit 75db90d

Browse files
committed
Fixes to lifetimes for spawn
1 parent 49085d3 commit 75db90d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

text/0000-scoped-take-2.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ To recover scoped threads, we extend the `Scope` type with a method for spawning
9898
threads:
9999

100100
```rust
101-
impl<'defer> Scope<'defer> {
102-
pub fn spawn<'body, F, T>(&self, f: F) -> thread::JoinHandle<T> where
103-
'defer: 'body, // anything borrowed by the body must outlive the Scope
104-
F: FnOnce() -> T + Send + 'body,
105-
T: Send + 'body;
101+
impl<'a> Scope<'a> {
102+
pub fn spawn<F, T>(&self, f: F) -> thread::JoinHandle<T> where
103+
F: FnOnce() -> T + Send + 'a,
104+
T: Send + 'a;
106105
}
107106
```
108107

0 commit comments

Comments
 (0)