Skip to content

Commit 61feafb

Browse files
committed
fixup: fix unrelated clippy warnings
Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent 8af861c commit 61feafb

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/hyperlight_host/src/mem/layout.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,24 @@ impl SandboxMemoryLayout {
224224
pub(crate) const PML4_OFFSET: usize = 0x0000;
225225
/// The offset into the sandbox's memory where the Page Directory Pointer
226226
/// Table starts.
227+
#[cfg(feature = "init-paging")]
227228
pub(super) const PDPT_OFFSET: usize = 0x1000;
228229
/// The offset into the sandbox's memory where the Page Directory starts.
230+
#[cfg(feature = "init-paging")]
229231
pub(super) const PD_OFFSET: usize = 0x2000;
230232
/// The offset into the sandbox's memory where the Page Tables start.
233+
#[cfg(feature = "init-paging")]
231234
pub(super) const PT_OFFSET: usize = 0x3000;
232235
/// The address (not the offset) to the start of the page directory
236+
#[cfg(feature = "init-paging")]
233237
pub(super) const PD_GUEST_ADDRESS: usize = Self::BASE_ADDRESS + Self::PD_OFFSET;
234238
/// The address (not the offset) into sandbox memory where the Page
235239
/// Directory Pointer Table starts
240+
#[cfg(feature = "init-paging")]
236241
pub(super) const PDPT_GUEST_ADDRESS: usize = Self::BASE_ADDRESS + Self::PDPT_OFFSET;
237242
/// The address (not the offset) into sandbox memory where the Page
238243
/// Tables start
244+
#[cfg(feature = "init-paging")]
239245
pub(super) const PT_GUEST_ADDRESS: usize = Self::BASE_ADDRESS + Self::PT_OFFSET;
240246
/// The maximum amount of memory a single sandbox will be allowed.
241247
/// The addressable virtual memory with current paging setup is virtual address 0x0 - 0x40000000 (excl.),

src/hyperlight_host/src/mem/mgr.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ impl SandboxMemoryManager<ExclusiveSharedMemory> {
340340
shared_mem.write_u64(offset, load_addr_u64)?;
341341
}
342342

343+
// The load method returns a LoadInfo which can also be a different type once the
344+
// `unwind_guest` feature is enabled.
345+
#[allow(clippy::let_unit_value)]
343346
let load_info = exe_info.load(
344347
load_addr.clone().try_into()?,
345348
&mut shared_mem.as_mut_slice()[layout.get_guest_code_offset()..],

src/hyperlight_host/src/sandbox/initialized_multi_use.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ impl MultiUseSandbox {
162162
/// Map the contents of a file into the guest at a particular address
163163
///
164164
/// Returns the length of the mapping
165+
#[allow(dead_code)]
165166
#[instrument(err(Debug), skip(self, _fp, _guest_base), parent = Span::current())]
166167
pub(crate) fn map_file_cow(&mut self, _fp: &Path, _guest_base: u64) -> Result<u64> {
167168
#[cfg(windows)]

0 commit comments

Comments
 (0)