SMACK's Box implementation fails to type check with the following message,
error[E0507]: cannot move out of dereference of `smack::Box<Pizza>`
--> ml.rs:25:67
|
25 | Pizza::Cheese(p) => Pizza::Cheese(Box::new(remove_anchovy(*p))),
| ^^ move occurs because value has type `Pizza`, which does not implement the `Copy` trait
It seems *Box<T> is not (cannot be) desugared into a call to deref but instead is treated uniquely by rustc.
Consider this program,
SMACK's
Box
implementation fails to type check with the following message,It seems
*Box<T>
is not (cannot be) desugared into a call toderef
but instead is treated uniquely by rustc.This blog post discusses this issue: https://manishearth.github.io/blog/2017/01/10/rust-tidbits-box-is-special/