From 152bde63fecfd2bc3b2296b36cf9140b977ff035 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 7 Mar 2020 11:27:49 +0100 Subject: [PATCH] Misc changes --- src/constant.rs | 6 +----- src/debuginfo/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/constant.rs b/src/constant.rs index e82ddaaf749..b67637ff214 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -261,11 +261,7 @@ fn data_id_for_static( } let mut data_ctx = DataContext::new(); - let zero_bytes = std::iter::repeat(0) - .take(pointer_ty(tcx).bytes() as usize) - .collect::>() - .into_boxed_slice(); - data_ctx.define(zero_bytes); + data_ctx.define_zeroinit(pointer_ty(tcx).bytes() as usize); match module.define_data(data_id, &data_ctx) { // Everytime a weak static is referenced, there will be a zero pointer definition, // so duplicate definitions are expected and allowed. diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs index f9048ad4010..c90f5fa6aed 100644 --- a/src/debuginfo/mod.rs +++ b/src/debuginfo/mod.rs @@ -67,8 +67,8 @@ impl<'tcx> DebugContext<'tcx> { dwarf.unit.line_program = line_program; { - let name = dwarf.strings.add(&*name); - let comp_dir = dwarf.strings.add(&*comp_dir); + let name = dwarf.strings.add(name); + let comp_dir = dwarf.strings.add(comp_dir); let root = dwarf.unit.root(); let root = dwarf.unit.get_mut(root);