about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-27 02:38:50 +0000
committerbors <bors@rust-lang.org>2020-04-27 02:38:50 +0000
commitef71df106b957eb84c1f028240ba8e85b614d043 (patch)
tree01ecd1395ad020e1f69435278418196d4ada5ebf /src/liballoc
parent5794e779a62aa1208311ac8b4f9603cad8f31912 (diff)
parentcddbed00032080b947542307249fa141331887be (diff)
downloadrust-ef71df106b957eb84c1f028240ba8e85b614d043.tar.gz
rust-ef71df106b957eb84c1f028240ba8e85b614d043.zip
Auto merge of #71600 - Dylan-DPC:rollup-7tvzi9n, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #68716 (Stabilize `Span::mixed_site`)
 - #71263 (Remove unused abs_path method from rustc_span::source_map::FileLoader)
 - #71409 (Point at the return type on `.into()` failure caused by `?`)
 - #71419 (add message for resolution failure because wrong namespace)
 - #71438 (Tweak some suggestions in `rustc_resolve`)
 - #71589 (remove Unique::from for shared pointer types)

Failed merges:

r? @ghost
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/collections/btree/node.rs2
-rw-r--r--src/liballoc/raw_vec.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs
index 84d34db2d45..5569c293e2f 100644
--- a/src/liballoc/collections/btree/node.rs
+++ b/src/liballoc/collections/btree/node.rs
@@ -131,7 +131,7 @@ impl<K, V> BoxedNode<K, V> {
     }
 
     unsafe fn from_ptr(ptr: NonNull<LeafNode<K, V>>) -> Self {
-        BoxedNode { ptr: Unique::from(ptr) }
+        BoxedNode { ptr: Unique::new_unchecked(ptr.as_ptr()) }
     }
 
     fn as_ptr(&self) -> NonNull<LeafNode<K, V>> {
diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs
index 0780b33e53a..ca165b61e26 100644
--- a/src/liballoc/raw_vec.rs
+++ b/src/liballoc/raw_vec.rs
@@ -151,7 +151,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
 
             let memory = alloc.alloc(layout, init).unwrap_or_else(|_| handle_alloc_error(layout));
             Self {
-                ptr: memory.ptr.cast().into(),
+                ptr: unsafe { Unique::new_unchecked(memory.ptr.cast().as_ptr()) },
                 cap: Self::capacity_from_bytes(memory.size),
                 alloc,
             }
@@ -469,7 +469,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
     }
 
     fn set_memory(&mut self, memory: MemoryBlock) {
-        self.ptr = memory.ptr.cast().into();
+        self.ptr = unsafe { Unique::new_unchecked(memory.ptr.cast().as_ptr()) };
         self.cap = Self::capacity_from_bytes(memory.size);
     }