News for hackers. Stuff that matters.
Re:Rust – Compile Time Memory Safety by lmitchell on Monday April 22, 2019 @10:06PM (#19725013)
The only thing 'unspecified' guarantees you in this context is 'safe to destroy'. It specifically does not guarantee the safety of any other member functions - only the destructor. So either push_back() or pop_back() could potentially cause UB here (specifically, it's quite possible that the move swaps some internal pointers for nullptr, so you end up dereferencing null here - but morally, it's just never okay to continue using a moved-from object).
Re:Rust – Compile Time Memory Safety by millstone on Monday April 22, 2019 @10:22PM (#19725074)
The vector is "valid" and that is what carries all the weight here. The vector is still a vector.

push_back is absolutely defined. pop_back might be undefined, because pop_back is UB on an empty vector. If you like, call clear, and be assured of an empty, reusable vector. It's not idiomatic, but it's safe.