I would very much like a solution to this problem. I don't have a strong preference for any particular syntax.
Some past discussions:
-
RFC 462 proposed adding a
deref
keyword, by analogy with theref
keyword. -
RFC issue 2099 proposed generalizing
&
patterns to work on any Deref type. -
RFC 809 proposed generalizing the
box
keyword to work with types other thanBox<T>
. (See also this forum thread.)