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

Remove usize trait impls #364

Merged
merged 2 commits into from
Mar 28, 2022
Merged

Remove usize trait impls #364

merged 2 commits into from
Mar 28, 2022

Conversation

josephlr
Copy link
Contributor

This removes Add/AddAssign/Sub/SubAssign with usize from
VirtAddr and PhysAddr (which are always 64-bit, even on 32-bit
platforms). This makes it possible to write code like:

let addr1 = PhysAddr::new(0x52);
let addr2 = addr1 + 3;

without getting a "multiple impls" compiler error.

This is essentially the breaking change mentioned in
#293 (comment)

Signed-off-by: Joe Richey [email protected]

@josephlr josephlr mentioned this pull request Mar 28, 2022
13 tasks
This removes `Add`/`AddAssign`/`Sub`/`SubAssign` with `usize` from
`VirtAddr` and `PhysAddr` (which are always 64-bit, even on 32-bit
platforms). This makes it possible to write code like:

```rust
let addr1 = PhysAddr::new(0x52);
let addr2 = addr1 + 3;
```

without getting a "multiple `impl`s" compiler error.

This is essentially the breaking change mentioned in
#293 (comment)

Signed-off-by: Joe Richey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants