Skip to content

Commit 7a5418d

Browse files
committed
fix aliasing violations in thread_local_const_init
1 parent 6765010 commit 7a5418d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/thread/local.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ macro_rules! __thread_local_inner {
217217
// so now.
218218
0 => {
219219
$crate::thread::__FastLocalKeyInner::<$t>::register_dtor(
220-
&VAL as *const _ as *mut u8,
220+
$crate::ptr::addr_of_mut!(VAL) as *mut u8,
221221
destroy,
222222
);
223223
STATE = 1;

0 commit comments

Comments
 (0)