about summary refs log tree commit diff
path: root/src/liballoc/allocator.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-06-25 11:33:47 -0700
committerAlex Crichton <alex@alexcrichton.com>2017-06-25 11:35:05 -0700
commitd24d408af387e99e7237f21e9a8d13a35552e01a (patch)
treec2255819e331a6254e20930ac45bd10db32c0b3d /src/liballoc/allocator.rs
parentc9bb93576d4484edd1b3c40eb2aea0dfa0788851 (diff)
downloadrust-d24d408af387e99e7237f21e9a8d13a35552e01a.tar.gz
rust-d24d408af387e99e7237f21e9a8d13a35552e01a.zip
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"))
         }