Skip to content

Commit

Permalink
Rollup merge of rust-lang#84291 - RalfJung:thread-local-const-init, r…
Browse files Browse the repository at this point in the history
…=alexcrichton

fix aliasing violations in thread_local_const_init

Fixes rust-lang#83416 (comment)

r? `@alexcrichton` `@sfackler`
  • Loading branch information
Dylan-DPC authored Apr 19, 2021
2 parents fb78dc0 + 7a5418d commit 7612435
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/thread/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7612435

Please sign in to comment.