diff options
| author | Ralf Jung <post@ralfj.de> | 2021-04-18 10:55:09 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2021-04-18 10:55:09 +0200 |
| commit | 7a5418dae1bd2f3bd158278ee1273309bfad01c5 (patch) | |
| tree | 7375cc80bcd7ee9cbb4b6d0c5c6e185e1e1b5e29 /library/std/src/thread | |
| parent | 67650104959003d1a5828f8d79ad72aa08752055 (diff) | |
| download | rust-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.rs | 2 |
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; |
