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);