Skip to content

Commit 91bc23e

Browse files
committed
Fix objdiff-wasm build
1 parent c9c3b32 commit 91bc23e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

objdiff-core/src/obj/dwarf2.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
use alloc::{borrow::Cow, vec::Vec};
2+
13
use anyhow::{Context, Result};
2-
use object::{Object, ObjectSection};
4+
use object::{Object as _, ObjectSection as _};
35
use typed_arena::Arena;
46

57
use crate::obj::{Section, SectionKind};
@@ -83,7 +85,7 @@ fn load_file_section<'input, 'arena, Endian: gimli::Endianity>(
8385
id: gimli::SectionId,
8486
file: &object::File<'input>,
8587
endian: Endian,
86-
arena_data: &'arena Arena<alloc::borrow::Cow<'input, [u8]>>,
88+
arena_data: &'arena Arena<Cow<'input, [u8]>>,
8789
arena_relocations: &'arena Arena<RelocationMap>,
8890
) -> Result<Relocate<'arena, gimli::EndianSlice<'arena, Endian>>> {
8991
let mut relocations = RelocationMap::default();
@@ -93,14 +95,15 @@ fn load_file_section<'input, 'arena, Endian: gimli::Endianity>(
9395
section.uncompressed_data()?
9496
}
9597
// Use a non-zero capacity so that `ReaderOffsetId`s are unique.
96-
None => alloc::borrow::Cow::Owned(Vec::with_capacity(1)),
98+
None => Cow::Owned(Vec::with_capacity(1)),
9799
};
98100
let data_ref = arena_data.alloc(data);
99101
let section = gimli::EndianSlice::new(data_ref, endian);
100102
let relocations = arena_relocations.alloc(relocations);
101103
Ok(Relocate::new(section, relocations))
102104
}
103105

106+
#[inline]
104107
fn gimli_error(e: gimli::Error, context: &str) -> anyhow::Error {
105108
anyhow::anyhow!("gimli error {context}: {e:?}")
106109
}

0 commit comments

Comments
 (0)