Type coercion for Arc

…and going from T to U is already the dereference (considering T is a smart pointer to U), thus Deref::deref going from &U to &T can/should be seen as sort of "dereference" too… :exploding_head: That is an interesting way to see it. (Hope I got it right now.)

I guess the confusing thing here is that both

  • going from T to U
  • and going from &U to U

is a dereference.

Actually we got two dereferences (and one reference) happening when we write *x, because *x expands to *Deref::deref(&x):

  • &x goes from T to &T,
  • Deref::deref goes from &T to &U,
  • and * goes from &U to U.

Overall, we go from T to U, which is our overall "dereference" (and Deref::deref plays the integral part here).