diff options
| author | Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> | 2020-08-04 19:24:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-04 19:24:08 +0200 |
| commit | 93d98328d161bcdf002f9d2f7f916f01c6fce3b1 (patch) | |
| tree | db71831adf70d3cb55c180574d291ff3671d5222 /library/core/src/alloc | |
| parent | 929e37d4bfb2d6c99094a8a89c5feda47d25bbbe (diff) | |
| download | rust-93d98328d161bcdf002f9d2f7f916f01c6fce3b1.tar.gz rust-93d98328d161bcdf002f9d2f7f916f01c6fce3b1.zip | |
Revert missing "memory block"
Diffstat (limited to 'library/core/src/alloc')
| -rw-r--r-- | library/core/src/alloc/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs index d2c3e478650..2833768f213 100644 --- a/library/core/src/alloc/mod.rs +++ b/library/core/src/alloc/mod.rs @@ -128,7 +128,7 @@ pub unsafe trait AllocRef { /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html fn alloc_zeroed(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { let ptr = self.alloc(layout)?; - // SAFETY: `alloc` returns a valid memory slice + // SAFETY: `alloc` returns a valid memory block unsafe { ptr.as_non_null_ptr().as_ptr().write_bytes(0, ptr.len()) } Ok(ptr) } |
