std: broaden the allowed behaviour for recursive TLS initialization

This commit is contained in:
joboet 2023-09-26 12:54:01 +02:00
parent 96ab09dbdd
commit 559ec69e41
No known key found for this signature in database
GPG Key ID: 704E0149B0194B3C

View File

@ -29,9 +29,9 @@ use crate::fmt;
/// within a thread, and values that implement [`Drop`] get destructed when a
/// thread exits. Some caveats apply, which are explained below.
///
/// A `LocalKey`'s initializer cannot recursively depend on itself, and using
/// a `LocalKey` in this way will cause the initializer to infinitely recurse
/// on the first call to `with`.
/// 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`.
///
/// # Examples
///