Clarify terminology around destructors and dropping
In #1037 a question came up about the exact wording around the introduction of the destructors chapter which says
When an initialized variable or temporary goes out of scope its destructor is run, or it is dropped.
The PR author interpreted the phrase dropped meaning a synonym for running the destructor. But I read it as two separate concepts:
- When any value goes out of scope, it is "dropped".
- If the value has a destructor, that destructor is run.
I don't think "dropping" and "running destructors" can be used interchangeably because not all values have a destructor. However, I am uncertain if that is correct, or if that is the best way to document these concepts. Either way, it would be good to clarify that a little.
I think all values have destructors, but (in C++ term) not all destructors are non-trivial. On the other hand, std::mem::needs_drop's naming is really a little confusing...
According to the documentation for the Drop trait, "[Copy types] cannot have destructors", so they can't possibly be synonyms.