From df7789c902eb198a107422dd8e4e4c81ec3cb6ad Mon Sep 17 00:00:00 2001 From: Tomas Tauber <2410580+tomtau@users.noreply.github.com> Date: Sat, 14 Sep 2019 10:06:05 +0800 Subject: [PATCH 1/2] Made a thread local storage panic message more explanatory (TLS is usually understood as Transport Layer Security outside rust-std internals) --- src/libstd/thread/local.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs index f85b5d632f1..a2bbe371de7 100644 --- a/src/libstd/thread/local.rs +++ b/src/libstd/thread/local.rs @@ -236,8 +236,8 @@ impl LocalKey { #[stable(feature = "rust1", since = "1.0.0")] pub fn with(&'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 it is destroyed") } /// Acquires a reference to the value in this TLS key. From 68c3739f1268e496c096d89ab9e556f196e35974 Mon Sep 17 00:00:00 2001 From: Tomas Tauber <2410580+tomtau@users.noreply.github.com> Date: Mon, 16 Sep 2019 12:13:02 +0800 Subject: [PATCH 2/2] updated the panic message wording --- src/libstd/thread/local.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs index a2bbe371de7..e92c0d1c58e 100644 --- a/src/libstd/thread/local.rs +++ b/src/libstd/thread/local.rs @@ -237,7 +237,7 @@ impl LocalKey { pub fn with(&'static self, f: F) -> R where F: FnOnce(&T) -> R { self.try_with(f).expect("cannot access a Thread Local Storage value \ - during or after it is destroyed") + during or after destruction") } /// Acquires a reference to the value in this TLS key.