about summary refs log tree commit diff
path: root/src/liballoc/allocator.rs
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>2017-06-29 08:40:06 +0000
committerGitHub <noreply@github.com>2017-06-29 08:40:06 +0000
commitea762f2bff365a76b9dc18417e8c6e012815d960 (patch)
treef4f6fbc13a87fdf9e61cb742af6d337dd84123af /src/liballoc/allocator.rs
parenteffd1e040ea34c02892209caf0b46d535d4940e8 (diff)
parentd24d408af387e99e7237f21e9a8d13a35552e01a (diff)
downloadrust-ea762f2bff365a76b9dc18417e8c6e012815d960.tar.gz
rust-ea762f2bff365a76b9dc18417e8c6e012815d960.zip
Rollup merge of #42901 - alexcrichton:alloc-one, r=sfackler
std: Fix implementation of `Alloc::alloc_one`

This had an accidental `u8 as *mut T` where it was intended to have just a
normal pointer-to-pointer cast.

Closes #42827
Diffstat (limited to 'src/liballoc/allocator.rs')
-rw-r--r--src/liballoc/allocator.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liballoc/allocator.rs b/src/liballoc/allocator.rs
index 9bddce29957..bf38629ed38 100644
--- a/src/liballoc/allocator.rs
+++ b/src/liballoc/allocator.rs
@@ -873,7 +873,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(p as *mut T)) }
         } else {
             Err(AllocErr::invalid_input("zero-sized type invalid for alloc_one"))
         }