Skip to content

Commit 719a595

Browse files
Update mod.rs
removes unnecessary `unsafe`, adds `unstable` attribute
1 parent fbb9568 commit 719a595

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/libstd/thread/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ impl Builder {
391391
}
392392

393393
/// TODO: Doc
394+
#[unstable(feature = "thread_spawn_unchecked", issue = "0")]
394395
pub unsafe fn spawn_unchecked<'a, F, T>(self, f: F) -> io::Result<JoinHandle<T>> where
395396
F: FnOnce() -> T, F: Send + 'a, T: Send + 'a
396397
{
@@ -421,9 +422,7 @@ impl Builder {
421422
};
422423

423424
Ok(JoinHandle(JoinInner {
424-
native: unsafe {
425-
Some(imp::Thread::new(stack_size, Box::new(main))?)
426-
},
425+
native: Some(imp::Thread::new(stack_size, Box::new(main))?),
427426
thread: my_thread,
428427
packet: Packet(my_packet),
429428
}))

0 commit comments

Comments
 (0)