rc::Weak extending lifetime?

The problem is that the value isn't 'static because it captures the 'a input value. If the Weak is upgraded elsewhere, that elsewhere can retrieve and copy out the inner 'a value, but it has no idea what 'a is.

Reference counting with Rc<T> only really works to share ownership of T, but it cannot change the lifetime of T itself (in this case, RefCell<Foo<'a, T>>).

2 Likes