Add debug asserts in thread local cell set methods.

This commit is contained in:
Mara Bos 2021-12-20 19:20:56 +01:00
parent 93c409d6e2
commit 36c904594e

View File

@ -268,6 +268,8 @@ const fn __init() -> $t { INIT_EXPR }
if let $crate::option::Option::Some(init) = _init {
if let $crate::option::Option::Some(value) = init.take() {
return value;
} else if $crate::cfg!(debug_assertions) {
unreachable!("missing initial value");
}
}
__init()
@ -341,6 +343,8 @@ unsafe fn __getit(
if let $crate::option::Option::Some(init) = init {
if let $crate::option::Option::Some(value) = init.take() {
return value;
} else if $crate::cfg!(debug_assertions) {
unreachable!("missing default value");
}
}
__init()