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
This commit is contained in:
@@ -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"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user