Skip to content

improve VirtAddr Add & Sub impls #543

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

Merged
merged 2 commits into from
Apr 26, 2025
Merged

Conversation

Freax13
Copy link
Member

@Freax13 Freax13 commented Apr 26, 2025

This PR improves the panic messages and documentation for VirtAddr's Add/Sub impls.

Cc @tsatke
Closes #541

Previously, the error message didn't make it immediately obvious what
went wrong.
Let's be a bit more explicit.
Note that "attempt to add/subtract with overflow" is the panic message
used by Rust for normal arithmetic operations.
@Freax13 Freax13 requested a review from phil-opp April 26, 2025 06:29
Document when the functions panic and mention Step as an alternative
for those looking for a successor/predecessor operation.
@Freax13 Freax13 force-pushed the enhancement/address-gap-panics branch from bfb71b2 to 0de6929 Compare April 26, 2025 06:38
@Freax13
Copy link
Member Author

Freax13 commented Apr 26, 2025

The failing CI jobs are unrelated to this PR and are fixed by #544 and #545.

Copy link
Member

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@Freax13 Freax13 merged commit 7e8a6b0 into master Apr 26, 2025
10 of 12 checks passed
@Freax13 Freax13 deleted the enhancement/address-gap-panics branch April 26, 2025 12:02
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.

VirtAddr subtraction panics on sign-extend boundary
2 participants