Foo
and Bar
don't implement Drop
though -- compiler generated "drop glue", which is not a Drop
implementation, recursively drops the members. I'd link you to documentation explaining this, but as far as I know, there is no official documentation which covers all of these details.
(If you impl Drop
for your structs, you will get a similar error.)
This covers what drop glue does, but I don't think it covers the difference in NLL or lexical terms.