about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorTaylor Cramer <cramertj@google.com>2018-01-09 11:39:23 -0800
committerTaylor Cramer <cramertj@google.com>2018-01-09 11:39:23 -0800
commit25574e58b68dae94f7d9931b5e648a327a94ecd1 (patch)
tree0679be6100cb262046d813cd2624e01a43f464fe /src/liballoc
parent8e7a609e635b728eba65d471c985ab462dc4cfc7 (diff)
downloadrust-25574e58b68dae94f7d9931b5e648a327a94ecd1.tar.gz
rust-25574e58b68dae94f7d9931b5e648a327a94ecd1.zip
Make core::ops::Place an unsafe trait
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/binary_heap.rs2
-rw-r--r--src/liballoc/boxed.rs2
-rw-r--r--src/liballoc/linked_list.rs4
-rw-r--r--src/liballoc/vec.rs2
-rw-r--r--src/liballoc/vec_deque.rs4
5 files changed, 7 insertions, 7 deletions
diff --git a/src/liballoc/binary_heap.rs b/src/liballoc/binary_heap.rs
index 94bbaf92ce9..3041f85cd4c 100644
--- a/src/liballoc/binary_heap.rs
+++ b/src/liballoc/binary_heap.rs
@@ -1211,7 +1211,7 @@ where T: Clone + Ord {
 #[unstable(feature = "collection_placement",
            reason = "placement protocol is subject to change",
            issue = "30172")]
-impl<'a, T> Place<T> for BinaryHeapPlace<'a, T>
+unsafe impl<'a, T> Place<T> for BinaryHeapPlace<'a, T>
 where T: Clone + Ord {
     fn pointer(&mut self) -> *mut T {
         self.place.pointer()
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 6f125cdba81..c8ab3f681f8 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -142,7 +142,7 @@ pub struct IntermediateBox<T: ?Sized> {
 #[unstable(feature = "placement_in",
            reason = "placement box design is still being worked out.",
            issue = "27779")]
-impl<T> Place<T> for IntermediateBox<T> {
+unsafe impl<T> Place<T> for IntermediateBox<T> {
     fn pointer(&mut self) -> *mut T {
         self.ptr as *mut T
     }
diff --git a/src/liballoc/linked_list.rs b/src/liballoc/linked_list.rs
index 3ac5a85d721..ccb2da46f8d 100644
--- a/src/liballoc/linked_list.rs
+++ b/src/liballoc/linked_list.rs
@@ -1286,7 +1286,7 @@ impl<'a, T> Placer<T> for FrontPlace<'a, T> {
 #[unstable(feature = "collection_placement",
            reason = "placement protocol is subject to change",
            issue = "30172")]
-impl<'a, T> Place<T> for FrontPlace<'a, T> {
+unsafe impl<'a, T> Place<T> for FrontPlace<'a, T> {
     fn pointer(&mut self) -> *mut T {
         unsafe { &mut (*self.node.pointer()).element }
     }
@@ -1341,7 +1341,7 @@ impl<'a, T> Placer<T> for BackPlace<'a, T> {
 #[unstable(feature = "collection_placement",
            reason = "placement protocol is subject to change",
            issue = "30172")]
-impl<'a, T> Place<T> for BackPlace<'a, T> {
+unsafe impl<'a, T> Place<T> for BackPlace<'a, T> {
     fn pointer(&mut self) -> *mut T {
         unsafe { &mut (*self.node.pointer()).element }
     }
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs
index 301e44632b8..4a8982bf85c 100644
--- a/src/liballoc/vec.rs
+++ b/src/liballoc/vec.rs
@@ -2544,7 +2544,7 @@ impl<'a, T> Placer<T> for PlaceBack<'a, T> {
 #[unstable(feature = "collection_placement",
            reason = "placement protocol is subject to change",
            issue = "30172")]
-impl<'a, T> Place<T> for PlaceBack<'a, T> {
+unsafe impl<'a, T> Place<T> for PlaceBack<'a, T> {
     fn pointer(&mut self) -> *mut T {
         unsafe { self.vec.as_mut_ptr().offset(self.vec.len as isize) }
     }
diff --git a/src/liballoc/vec_deque.rs b/src/liballoc/vec_deque.rs
index f56aa23a4eb..df49c1df082 100644
--- a/src/liballoc/vec_deque.rs
+++ b/src/liballoc/vec_deque.rs
@@ -2564,7 +2564,7 @@ impl<'a, T> Placer<T> for PlaceBack<'a, T> {
 #[unstable(feature = "collection_placement",
            reason = "placement protocol is subject to change",
            issue = "30172")]
-impl<'a, T> Place<T> for PlaceBack<'a, T> {
+unsafe impl<'a, T> Place<T> for PlaceBack<'a, T> {
     fn pointer(&mut self) -> *mut T {
         unsafe { self.vec_deque.ptr().offset(self.vec_deque.head as isize) }
     }
@@ -2610,7 +2610,7 @@ impl<'a, T> Placer<T> for PlaceFront<'a, T> {
 #[unstable(feature = "collection_placement",
            reason = "placement protocol is subject to change",
            issue = "30172")]
-impl<'a, T> Place<T> for PlaceFront<'a, T> {
+unsafe impl<'a, T> Place<T> for PlaceFront<'a, T> {
     fn pointer(&mut self) -> *mut T {
         let tail = self.vec_deque.wrap_sub(self.vec_deque.tail, 1);
         unsafe { self.vec_deque.ptr().offset(tail as isize) }