update `TyDesc` and `TyVisitor`
vec: add `from_elem`, `truncate` and `set_len`
handle zero-size allocations correctly

The `malloc` family of functions may return a null pointer for a
zero-size allocation, which should not be interpreted as an
out-of-memory error.

If the implementation does not return a null pointer, then handling
this will result in memory savings for zero-size types.
follow the new iterator naming conventions
simplify `from_elem` and add `from_fn`
Merged with upstream