Skip to content

Commit d416fc1

Browse files
committed
Remove unsafe block around boxed::into_raw() as it is now safe
1 parent 04ab4a3 commit d416fc1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/libstd/sync/mpsc/spsc_queue.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,10 @@ unsafe impl<T: Send> Sync for Queue<T> { }
8080

8181
impl<T> Node<T> {
8282
fn new() -> *mut Node<T> {
83-
unsafe {
84-
boxed::into_raw(box Node {
85-
value: None,
86-
next: AtomicPtr::new(ptr::null_mut::<Node<T>>()),
87-
})
88-
}
83+
boxed::into_raw(box Node {
84+
value: None,
85+
next: AtomicPtr::new(ptr::null_mut::<Node<T>>()),
86+
})
8987
}
9088
}
9189

0 commit comments

Comments
 (0)