]> git.lizzy.rs Git - rust.git/commitdiff
Simplify allocation creation
authorSmitty <me@smitop.com>
Fri, 18 Jun 2021 19:17:13 +0000 (15:17 -0400)
committerSmitty <me@smitop.com>
Tue, 29 Jun 2021 23:08:29 +0000 (19:08 -0400)
compiler/rustc_middle/src/mir/interpret/allocation.rs

index 7405a70d39ad07fa64be055b3f6e782e8d4e1e53..36c87f335bd26029387a8e36706dcaad93d05bb5 100644 (file)
@@ -130,9 +130,8 @@ pub fn uninit(size: Size, align: Align) -> InterpResult<'static, Self> {
             InterpError::ResourceExhaustion(ResourceExhaustionInfo::MemoryExhausted)
         })?;
         bytes.resize(size.bytes_usize(), 0);
-        bytes.fill(0);
         Ok(Allocation {
-            bytes: bytes,
+            bytes,
             relocations: Relocations::new(),
             init_mask: InitMask::new(size, false),
             align,