Rollup merge of #64481 - tomtau:fix/tls-error-message, r=KodrAus

A more explanatory thread local storage panic message

Outside rust-std internals, TLS is usually understood as Transport Layer Security, so the existing message could be a bit puzzling when one has TLS sessions in `thread_local!`.
This commit is contained in:
Mazdak Farrokhzad 2019-09-25 03:48:26 +02:00 committed by GitHub
commit bc3afb76bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,8 +236,8 @@ impl<T: 'static> LocalKey<T> {
#[stable(feature = "rust1", since = "1.0.0")]
pub fn with<F, R>(&'static self, f: F) -> R
where F: FnOnce(&T) -> R {
self.try_with(f).expect("cannot access a TLS value during or \
after it is destroyed")
self.try_with(f).expect("cannot access a Thread Local Storage value \
during or after destruction")
}
/// Acquires a reference to the value in this TLS key.