We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c358b1 commit 22917f8Copy full SHA for 22917f8
src/addr.rs
@@ -88,6 +88,11 @@ impl VirtAddr {
88
}
89
90
/// Creates a virtual address from the given pointer
91
+ // cfg(target_pointer_width = "32") is only here for backwards
92
+ // compatibility: Earlier versions of this crate did not have any `cfg()`
93
+ // on this function. At least for 32- and 64-bit we know the `as u64` cast
94
+ // doesn't truncate.
95
+ #[cfg(any(target_pointer_width = "32", target_pointer_width = "64"))]
96
pub fn from_ptr<T>(ptr: *const T) -> Self {
97
Self::new(ptr as u64)
98
0 commit comments