diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-04-19 22:00:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-19 22:00:09 +0200 |
| commit | 761243572e8ed83368f9bdcc7e0198ef1bea3a66 (patch) | |
| tree | d214b4dce07461286e2ea4144d63c34ee9e31294 /library/std/src/thread | |
| parent | fb78dc05e4ada40182712c82481acdd50451e632 (diff) | |
| parent | 7a5418dae1bd2f3bd158278ee1273309bfad01c5 (diff) | |
| download | rust-761243572e8ed83368f9bdcc7e0198ef1bea3a66.tar.gz rust-761243572e8ed83368f9bdcc7e0198ef1bea3a66.zip | |
Rollup merge of #84291 - RalfJung:thread-local-const-init, r=alexcrichton
fix aliasing violations in thread_local_const_init Fixes https://github.com/rust-lang/rust/pull/83416#discussion_r615364774 r? `@alexcrichton` `@sfackler`
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; |
