diwic / reffers-rs

Rust wrappers around references, boxes and Arcs.
68 stars 3 forks source link

aref::Descend trait documentation mentions GAT but not variance #6

Closed jplatte closed 4 years ago

jplatte commented 4 years ago

Having been down this rabbit hole myself before, I would like to encourage you to be a bit clearerin Descends documentation, as currently it sounds like it would be possible to implement safely once GAT are available.

AFAIK, this is not possible because with the current GATs there is no syntax to declare a generic associated type to be covariant over one of its generic parameters, and without declaring that a lifetime-generic Deref is unsound. rental makes a note of variance in its documentation, I would suggest you do the same :)

diwic commented 4 years ago

I was under the impression that GAT alone was able to fix this, but I haven't followed its development closely. If it isn't, then maybe GAT should not be mentioned at all. Thanks!