-
Notifications
You must be signed in to change notification settings - Fork 144
Closed
Description
rustc has a -Csave-temps option that is intended for debugging (or other cases where temporary file access is useful).
We used to have code like this, but it behaved incorrectly in the presence of panics in the intermediary code. It would be nice to have a boolean flag on the builder that would let us do something like .cleanup(opts.save_temps) and that would create a TempDir which doesn't delete itself on Drop.
For now we've implemented this in rustc itself atop TempDir, but upstreaming it would be more convenient API wise.
let tmpdir = ...;
// a bunch of code runs, using tmpdir
if opts.save_temps {
let _ = tmpdir.into_path();
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels