]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #82105 - nagisa:nagisa/ensure-removed, r=petrochenkov
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 17 Feb 2021 19:37:57 +0000 (20:37 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Feb 2021 19:37:57 +0000 (20:37 +0100)
commit7292d5ff60a914b61077764e1b10362b6cd1842b
treedfa2d82bf2734fd9b17c56f2f708ae255427a304
parent253631d73fdb310a437edff1134caee904e28b94
parentfa3621b468263828b5e1a1b1563e0b9cb7209e96
Rollup merge of #82105 - nagisa:nagisa/ensure-removed, r=petrochenkov

Don't fail to remove files if they are missing

In the backend we may want to remove certain temporary files, but in
certain other situations these files might not be produced in the first
place. We don't exactly care about that, and the intent is really that
these files are gone after a certain point in the backend.

Here we unify the backend file removing calls to use `ensure_removed`
which will attempt to delete a file, but will not fail if it does not
exist (anymore).

The tradeoff to this approach is, of course, that we may miss instances
were we are attempting to remove files at wrong paths due to some bug –
compilation would silently succeed but the temporary files would remain
there somewhere.