Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit 6ee38d0

Browse files
committed
Revert "Rust update broke build. Fixed!"
This reverts commit fd48191.
1 parent 14141db commit 6ee38d0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

hypervisor/src/intel/addresses.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
use {
88
crate::intel::paging::PageTables,
9+
core::ops::{Deref, DerefMut},
910
x86::bits64::paging::{PAddr, BASE_PAGE_SHIFT},
1011
};
1112

@@ -75,6 +76,22 @@ impl PhysicalAddress {
7576
}
7677
}
7778

79+
impl const Deref for PhysicalAddress {
80+
type Target = PAddr;
81+
82+
/// Dereferences the `PhysicalAddress` to retrieve the underlying `PAddr`.
83+
fn deref(&self) -> &Self::Target {
84+
&self.0
85+
}
86+
}
87+
88+
impl const DerefMut for PhysicalAddress {
89+
/// Provides mutable access to the underlying `PAddr`.
90+
fn deref_mut(&mut self) -> &mut Self::Target {
91+
&mut self.0
92+
}
93+
}
94+
7895
/// Converts a virtual address to its corresponding physical address.
7996
///
8097
/// # Arguments

0 commit comments

Comments
 (0)