Hacker News new | ask | show | jobs
by Rusky 2957 days ago
The match changes here don't bother me anywhere near as much as deref coercions do, because they preserve the level of indirection.

Deref coercion makes a &Box<T> behave like a &T (removing a level of indirection). Default binding modes only make a &(T, U) behave like a (&T, &U).

I've idly wondered whether it would have been possible to replace deref coercions with something like this. Making Box<T> behave like &T kinda works but loses you the ability to control `&T` vs `&mut T`, but maybe `x.y` where `x: &T` could "pass the reference on" giving you a `&U`.