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 Reference Conversion APIs at std::NonNull #116

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

danielhumanmod
Copy link

@danielhumanmod danielhumanmod commented Oct 16, 2024

Description:
This PR introduces function contracts and proof harness for the NonNull pointer in the Rust core library. Specifically, it verifies reference conversion APIs, covering:

  • NonNull::as_mut<'a>
  • NonNull::as_ref<'a>
  • NonNull::as_uninit_mut<'a>
  • NonNull::as_uninit_ref<'a>
  • NonNull::as_uninit_slice<'a>
  • NonNull::as_uninit_slice_mut<'a>
  • NonNull::get_unchecked_mut

Proof harness:

  • non_null_check_as_mut
  • non_null_check_as_ref
  • non_null_check_as_uninit_mut
  • non_null_check_as_as_uninit_ref
  • non_null_check_as_as_uninit_slice
  • non_null_check_as_uninit_slice_mut
  • non_null_check_as_get_unchecked_mut

Resolves #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 October 25, 2024 19:06
@danielhumanmod danielhumanmod requested a review from a team as a code owner October 25, 2024 19:06
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.

Challenge 6: Safety of NonNull
1 participant