about summary refs log tree commit diff
path: root/src/liballoc/allocator.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-26 21:08:38 +0000
committerbors <bors@rust-lang.org>2017-07-26 21:08:38 +0000
commit599be0d18f4c6ddf36366d2a5a2ca6dc65886896 (patch)
treeb45698b672fa56662213f15740197fc32db9252f /src/liballoc/allocator.rs
parentd02fb3bcf42c05740a47fdfb0d9e5dd8ec24ff37 (diff)
parent959ebd6785b48360ac48e334a18b3abe66beef17 (diff)
downloadrust-599be0d18f4c6ddf36366d2a5a2ca6dc65886896.tar.gz
rust-599be0d18f4c6ddf36366d2a5a2ca6dc65886896.zip
Auto merge of #43487 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 10 pull requests

- Successful merges: #42959, #43447, #43455, #43456, #43458, #43462, #43463, #43465, #43471, #43480
- Failed merges:
Diffstat (limited to 'src/liballoc/allocator.rs')
-rw-r--r--src/liballoc/allocator.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/liballoc/allocator.rs b/src/liballoc/allocator.rs
index ca5388b4701..efc59d2cbc8 100644
--- a/src/liballoc/allocator.rs
+++ b/src/liballoc/allocator.rs
@@ -892,7 +892,7 @@ pub unsafe trait Alloc {
     {
         let k = Layout::new::<T>();
         if k.size() > 0 {
-            unsafe { self.alloc(k).map(|p| Unique::new(p as *mut T)) }
+            unsafe { self.alloc(k).map(|p| Unique::new_unchecked(p as *mut T)) }
         } else {
             Err(AllocErr::invalid_input("zero-sized type invalid for alloc_one"))
         }
@@ -963,7 +963,7 @@ pub unsafe trait Alloc {
                 unsafe {
                     self.alloc(layout.clone())
                         .map(|p| {
-                            Unique::new(p as *mut T)
+                            Unique::new_unchecked(p as *mut T)
                         })
                 }
             }
@@ -1012,7 +1012,7 @@ pub unsafe trait Alloc {
         match (Layout::array::<T>(n_old), Layout::array::<T>(n_new), ptr.as_ptr()) {
             (Some(ref k_old), Some(ref k_new), ptr) if k_old.size() > 0 && k_new.size() > 0 => {
                 self.realloc(ptr as *mut u8, k_old.clone(), k_new.clone())
-                    .map(|p|Unique::new(p as *mut T))
+                    .map(|p|Unique::new_unchecked(p as *mut T))
             }
             _ => {
                 Err(AllocErr::invalid_input("invalid layout for realloc_array"))