about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-05-07 18:19:07 +0200
committerGitHub <noreply@github.com>2025-05-07 18:19:07 +0200
commit83e3d0e17b5484d2be639091ce2290e82e33a191 (patch)
tree064fa976f49339acb6f1f7616941b560401e9525 /compiler/rustc_pattern_analysis/src
parent7d372aec2f407e61d30f49875dee997cf2e70338 (diff)
parent442ae63257708962de9d43c4f9b44130e7926321 (diff)
downloadrust-83e3d0e17b5484d2be639091ce2290e82e33a191.tar.gz
rust-83e3d0e17b5484d2be639091ce2290e82e33a191.zip
Rollup merge of #140706 - GuillaumeGomez:fix-missing-temp-dir-cleanup, r=notriddle
[rustdoc] Ensure that temporary doctest folder is correctly removed even if doctests failed

Fixes #139899.

The bug was due to the fact that if any doctest fails for any reason, we call `exit` (or it's called inside `libtest` if not edition 2024), meaning that `TempDir`'s destructor isn't called, and therefore the temporary folder isn't cleaned up.

Took me a while to figure out how to reproduce but finally I was able to reproduce the bug with:

`````rust
#![doc(test(attr(deny(warnings))))]

//! ```
//! let a = 12;
//! ```
`````

And then I ensured that panicking doctests were cleaned up as well:

`````rust
//! ```
//! panic!();
//! ```
`````

And finally I checked if it was fixed for merged doctests too (`--edition 2024`).

To make this work, I needed to add a new public function in `libtest` too which would call a function once all tests have been run.

So only issue is: I have absolutely no idea how we can add a regression test for this fix. If anyone has an idea...

r? `@notriddle`
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions