From f936bc6b92dbee4e94988b9c46298f59481bd2ea Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 31 Oct 2020 16:22:16 +0100 Subject: [PATCH] fix writing to read-only raw pointer in thread-local test --- tests/run-pass/thread-local.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run-pass/thread-local.rs b/tests/run-pass/thread-local.rs index 1aa442edad3..72ab973b0f0 100644 --- a/tests/run-pass/thread-local.rs +++ b/tests/run-pass/thread-local.rs @@ -58,7 +58,7 @@ fn main() { // Initialize the keys we use to check destructor ordering for (key, global) in KEYS.iter_mut().zip(GLOBALS.iter_mut()) { *key = create(Some(mem::transmute(dtor as unsafe extern fn(*mut u64)))); - set(*key, global as *const _ as *mut _); + set(*key, global as *mut _ as *mut u8); } // Initialize cannary -- 2.44.0