]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/sys/unix/thread.rs
refactor[std]: do not use box syntax
[rust.git] / library / std / src / sys / unix / thread.rs
index 2a1830d060edc5cb934998bd1cac294e3512d281..cc0e5929569729ef17de83334958ca55eddad79f 100644 (file)
@@ -49,7 +49,7 @@ unsafe impl Sync for Thread {}
 impl Thread {
     // unsafe: see thread::Builder::spawn_unchecked for safety requirements
     pub unsafe fn new(stack: usize, p: Box<dyn FnOnce()>) -> io::Result<Thread> {
-        let p = Box::into_raw(box p);
+        let p = Box::into_raw(Box::new(p));
         let mut native: libc::pthread_t = mem::zeroed();
         let mut attr: libc::pthread_attr_t = mem::zeroed();
         assert_eq!(libc::pthread_attr_init(&mut attr), 0);