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
derefkeyword, by analogy with therefkeyword. -
RFC issue 2099 proposed generalizing
&patterns to work on any Deref type. -
RFC 809 proposed generalizing the
boxkeyword to work with types other thanBox<T>. (See also this forum thread.)