From 8410d269e3d94d370b5c4dd30a03e430fbbb88c7 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Wed, 20 May 2026 19:23:53 -0400 Subject: [PATCH] Document that destructors in running threads are not run on program exit Co-authored-by: Josh Triplett --- library/std/src/thread/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 00aeb70e6e076..955d1f61e7535 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -26,9 +26,10 @@ //! non-zero exit code. //! //! When the main thread of a Rust program terminates, the entire program shuts -//! down, even if other threads are still running. However, this module provides -//! convenient facilities for automatically waiting for the termination of a -//! thread (i.e., join). +//! down, even if other threads are still running, and any destructors on the +//! remaining threads' stacks may not be executed. However, this module +//! provides convenient facilities for automatically waiting for the +//! termination of a thread (i.e., join). //! //! ## Spawning a thread //!