It occurred to me while reading the documentation of TempDir::close()1 that:
Although TempDir removes the directory on drop, in the destructor any errors are ignored. To detect errors cleaning up the temporary directory, call close instead.
First of all, the documentation is in the wrong place - the behavior of
drop should be described along with
drop. My main issue is the behavior though: If I let Rust manage memory as it should and would, it will silently eats errors, unless I explicitly opt in. Errors should always be opt-out in my opinion.
In my opinion, it should at least log, if not even
panic! in such an event, notifying of the option to explicitly
close() to handle.
Is this a general mode of working for
std or is the problem being addressed otherwise?