An unofficial, read-only Hacker News reader.

2035 came early (opens external site)

1037 points by setheron 4 days ago | fzakaria.com | 382 comments on HN

View full thread · View on Hacker News

Comment thread (1)

  1. Right, if your use case works with thread::scope (as I mentioned) you can get it working.

    The thread::scope is kind of a workaround that may or may not work for your use case and I trust people are able to figure out that I’m illustrating a limitation, and not asking “how can I get this code to work”.

    If lifetimes could be bounded from above, then we could say that references which the closure borrows are bounded above by the scope containing the thread. We can’t do this, so we use thread::scope instead, which introduces a second closure just to work around the limitation.