about summary refs log tree commit diff
path: root/library/std/src/thread
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2021-04-18 10:55:09 +0200
committerRalf Jung <post@ralfj.de>2021-04-18 10:55:09 +0200
commit7a5418dae1bd2f3bd158278ee1273309bfad01c5 (patch)
tree7375cc80bcd7ee9cbb4b6d0c5c6e185e1e1b5e29 /library/std/src/thread
parent67650104959003d1a5828f8d79ad72aa08752055 (diff)
downloadrust-7a5418dae1bd2f3bd158278ee1273309bfad01c5.tar.gz
rust-7a5418dae1bd2f3bd158278ee1273309bfad01c5.zip
fix aliasing violations in thread_local_const_init
Diffstat (limited to 'library/std/src/thread')
-rw-r--r--library/std/src/thread/local.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs
index 37525e50604..3dcf7e33453 100644
--- a/library/std/src/thread/local.rs
+++ b/library/std/src/thread/local.rs
@@ -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;