We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e40e91c commit 7d782b5Copy full SHA for 7d782b5
bindings/rust/src/lib.rs
@@ -6,6 +6,7 @@
6
#![allow(non_upper_case_globals)]
7
#![allow(non_camel_case_types)]
8
#![allow(non_snake_case)]
9
+#![allow(unexpected_cfgs)]
10
11
extern crate alloc;
12
@@ -39,12 +40,11 @@ mod mt {
39
40
41
pub fn da_pool() -> ThreadPool {
42
static INIT: Once = Once::new();
- static mut POOL: *const Mutex<ThreadPool> =
43
- 0 as *const Mutex<ThreadPool>;
+ static mut POOL: *const Mutex<ThreadPool> = ptr::null();
44
45
INIT.call_once(|| {
46
let pool = Mutex::new(ThreadPool::default());
47
- unsafe { POOL = transmute(Box::new(pool)) };
+ unsafe { POOL = transmute::<Box<_>, *const _>(Box::new(pool)) };
48
});
49
unsafe { (*POOL).lock().unwrap().clone() }
50
}
0 commit comments