Add debug asserts in thread local cell set methods.
This commit is contained in:
parent
93c409d6e2
commit
36c904594e
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user