Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory address cast #666

Merged
merged 1 commit into from Jul 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions memory/src/address.rs
Expand Up @@ -112,9 +112,9 @@ where
}

/// Convert a mutable pointer to an `Address` with the same type
impl<T, U> From<*mut U> for Address<T, *mut U>
impl<T, U> From<*mut U> for Address<T, U>
where
Address<usize, *mut U>: Into<Address<T, *mut U>>,
Address<usize, U>: Into<Address<T, U>>,
{
#[inline]
fn from(value: *mut U) -> Self {
Expand All @@ -123,9 +123,9 @@ where
}

/// Convert a const pointer to an `Address` with the same type
impl<T, U> From<*const U> for Address<T, *const U>
impl<T, U> From<*const U> for Address<T, U>
where
Address<usize, *const U>: Into<Address<T, *const U>>,
Address<usize, U>: Into<Address<T, U>>,
{
#[inline]
fn from(value: *const U) -> Self {
Expand Down