We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93c409d commit 36c9045Copy full SHA for 36c9045
library/std/src/thread/local.rs
@@ -268,6 +268,8 @@ macro_rules! __thread_local_inner {
268
if let $crate::option::Option::Some(init) = _init {
269
if let $crate::option::Option::Some(value) = init.take() {
270
return value;
271
+ } else if $crate::cfg!(debug_assertions) {
272
+ unreachable!("missing initial value");
273
}
274
275
__init()
@@ -341,6 +343,8 @@ macro_rules! __thread_local_inner {
341
343
if let $crate::option::Option::Some(init) = init {
342
344
345
346
347
+ unreachable!("missing default value");
348
349
350
0 commit comments