Understanding a "may not live long enough" error inside move closure

Imagine T = &'borrow String. You can own a(n instance of type) T, and yet the instance is unusable after the 'borrow lifetime ends.

Saying that a type is 'static (e.g., T : 'static or impl ... + 'static + ...) means that your type does not contain any such short-lived reference / borrows, so that one can own it indefinitely.

See also the following posts:

2 Likes