Somewhat Random Idea: Deref patterns

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 the ref 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 than Box<T>. (See also this forum thread.)
9 Likes