]> git.lizzy.rs Git - rust.git/commitdiff
fix writing to read-only raw pointer in thread-local test
authorRalf Jung <post@ralfj.de>
Sat, 31 Oct 2020 15:22:16 +0000 (16:22 +0100)
committerRalf Jung <post@ralfj.de>
Sat, 31 Oct 2020 15:24:34 +0000 (16:24 +0100)
tests/run-pass/thread-local.rs

index 1aa442edad3b2734d9db3b88b76f3ce537681223..72ab973b0f08f80069f903b7389328255efd37da 100644 (file)
@@ -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