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

Contract and Harnesses for byte_add, byte_sub and byte_offset #169

Merged
merged 27 commits into from
Dec 5, 2024

Conversation

stogaru
Copy link

@stogaru stogaru commented Nov 18, 2024

Towards #76

Changes

  • Adds contracts for <*mut T>::byte_add, <*mut T>::byte_sub and <*mut T>::byte_offset.
  • Adds harnesses for the function verifying the following pointee types:
    • All integer types
    • Tuples (composite types)
    • Unit Type
    • Slices
  • Accomplishes this using a few macros.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@stogaru stogaru requested a review from a team as a code owner November 18, 2024 21:46
@stogaru
Copy link
Author

stogaru commented Nov 19, 2024

@feliperodri FYI

library/core/src/ptr/const_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/const_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/const_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/const_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/const_ptr.rs Show resolved Hide resolved
@stogaru stogaru changed the title Contract and Harnesses for <*mut T>::byte_add, byte_sub and byte_offset Contract and Harnesses for byte_add, byte_sub and byte_offset Nov 26, 2024
@feliperodri
Copy link

@jswrenn could you give another round of review for this one? I believe they have addressed all your comments.

Copy link

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

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

Two final nits, which you're welcome to take or leave.

Thanks for the contribution!

library/core/src/ptr/const_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/const_ptr.rs Outdated Show resolved Hide resolved
@stogaru stogaru force-pushed the verify/ptr_mut_byte branch from eea35b0 to eab2c65 Compare December 5, 2024 07:19
@stogaru stogaru requested a review from jswrenn December 5, 2024 07:27
Copy link

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for all the hard work on this.

@carolynzech carolynzech enabled auto-merge (squash) December 5, 2024 15:20
@carolynzech carolynzech merged commit dd75225 into model-checking:main Dec 5, 2024
10 checks passed
feliperodri added a commit that referenced this pull request Dec 9, 2024
…nd `byte_offset` (#188)

Towards #76 

This pull request impelments proof for contracts for `byte_add`,
`byte_sub` and `byte_offset` for `<dyn Trait>`. Both `const` and `mut`
versions are included.

It serves as an addition to an existing
[PR](#169) but is
submitted separately to avoid disrupting the ongoing review process for
that PR.

---------

Co-authored-by: Surya Togaru <stogaru@andrew.cmu.edu>
Co-authored-by: stogaru <143449212+stogaru@users.noreply.github.com>
Co-authored-by: Felipe R. Monteiro <rms.felipe@gmail.com>
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.

5 participants