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

Contracts & Harnesses for swap, replace, and drop_in_place #144

Merged
merged 19 commits into from
Nov 20, 2024

Conversation

danielhumanmod
Copy link

@danielhumanmod danielhumanmod commented Nov 1, 2024

Description

This PR introduces function contracts and proof harness for the NonNull pointer in the Rust core library. Specifically, it verifies three new APIs—swap, replace, and drop_in_place with Kani. These changes enhance the functionality of memory operations for NonNull pointers.

Change Overview

Covered APIs:

  1. NonNull::swap: Swaps the values at two mutable locations of the same type
  2. NonNull::replace: Replaces the pointer's value, returning the old value
  3. NonNull::drop_in_place: Executes the destructor (if any) of the pointed-to value

Towards #53

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

@danielhumanmod danielhumanmod marked this pull request as ready for review November 1, 2024 19:04
@danielhumanmod danielhumanmod requested a review from a team as a code owner November 1, 2024 19:04
library/core/src/ptr/non_null.rs Outdated Show resolved Hide resolved
library/core/src/ptr/non_null.rs Outdated Show resolved Hide resolved
library/core/src/ptr/non_null.rs Outdated Show resolved Hide resolved
library/core/src/ptr/non_null.rs Outdated Show resolved Hide resolved
library/core/src/ptr/non_null.rs Outdated Show resolved Hide resolved
library/core/src/ptr/non_null.rs Outdated Show resolved Hide resolved
library/core/src/ptr/non_null.rs Outdated Show resolved Hide resolved
library/core/src/ptr/non_null.rs Show resolved Hide resolved
library/core/src/ptr/non_null.rs Outdated Show resolved Hide resolved
library/core/src/ptr/non_null.rs Outdated Show resolved Hide resolved
@carolynzech
Copy link

@danielhumanmod Once you finish addressing Zyad's comments, can you mark them as resolved so we know to review this again?

@carolynzech carolynzech self-assigned this Nov 13, 2024
Copy link

@Eh2406 Eh2406 left a comment

Choose a reason for hiding this comment

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

Thank you

Copy link

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

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

Thanks

@danielhumanmod
Copy link
Author

Thanks for the approval @zhassan-aws , given that all checks have been passed, do you mind helping me to start the merge process?

@zhassan-aws zhassan-aws enabled auto-merge (squash) November 20, 2024 07:54
@zhassan-aws
Copy link

trigger approval workflow

@zhassan-aws zhassan-aws merged commit 8f5512d into model-checking:main Nov 20, 2024
9 checks passed
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.

4 participants