fix aliasing violations in thread_local_const_init

This commit is contained in:
Ralf Jung 2021-04-18 10:55:09 +02:00
parent 6765010495
commit 7a5418dae1

View File

@ -217,7 +217,7 @@ macro_rules! __thread_local_inner {
// so now.
0 => {
$crate::thread::__FastLocalKeyInner::<$t>::register_dtor(
&VAL as *const _ as *mut u8,
$crate::ptr::addr_of_mut!(VAL) as *mut u8,
destroy,
);
STATE = 1;