Created
April 14, 2017 13:49
-
-
Save stevedonovan/7e3a6d8c8921e3eff16c4b11ab82b8d7 to your computer and use it in GitHub Desktop.
An ergonomic way of saying Rc<RefCell>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It cannot be fixed currently. Deref has associated type
Target
which cannot be polymorphic (forall t'
), because of a few reasons, including lack of HKT. I don't think it will be possible even if GATs land, asforall t'
is not what we want to tell there, really. What we want to express is that this't
inTarget
is the same ast
on&'t self
. In order to express that, we would either need to change the definition ofDeref
(not going to happen), or we would need to have some special type checking rules. I do feel that the type system around lifetimes is not flexible as it should be, so hopefully, it could be expressible in the future.