about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLieselotte <52315535+she3py@users.noreply.github.com>2025-04-18 12:29:51 +0200
committerLieselotte <52315535+she3py@users.noreply.github.com>2025-04-18 14:11:32 +0200
commit0d56e3eed1c5f3edea5cae6171e7a706ad792463 (patch)
tree79bf9f569d93d6afb356dd907333d117ec102f6f
parent1f76d219c906f0112bb1872f33aa977164c53fa6 (diff)
downloadrust-0d56e3eed1c5f3edea5cae6171e7a706ad792463.tar.gz
rust-0d56e3eed1c5f3edea5cae6171e7a706ad792463.zip
LocalKey<T>: document that the dtor should not panic
-rw-r--r--library/std/src/thread/local.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs
index d5a5d10205d..7cd44873313 100644
--- a/library/std/src/thread/local.rs
+++ b/library/std/src/thread/local.rs
@@ -22,12 +22,16 @@ use crate::fmt;
 ///
 /// Initialization is dynamically performed on the first call to a setter (e.g.
 /// [`with`]) within a thread, and values that implement [`Drop`] get
-/// destructed when a thread exits. Some caveats apply, which are explained below.
+/// destructed when a thread exits. Some platform-specific caveats apply, which
+/// are explained below.
+/// Note that, should the destructor panics, the whole process will be [aborted].
 ///
 /// A `LocalKey`'s initializer cannot recursively depend on itself. Using a
 /// `LocalKey` in this way may cause panics, aborts or infinite recursion on
 /// the first call to `with`.
 ///
+/// [aborted]: crate::process::abort
+///
 /// # Single-thread Synchronization
 ///
 /// Though there is no potential race with other threads, it is still possible to