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

Refine challenges #247

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

Conversation

thanhnguyen-aws
Copy link

@thanhnguyen-aws thanhnguyen-aws commented Feb 17, 2025

In this PR, I refined the existing challenges by:

  • Added the missing contracts and harnesses for 3 functions write, write_bytes, write_unaligned for the NonNull challenge, then changed the status of this challenge to "resolved".
  • Edited some descriptions of smallsort
  • Removed the (optional) correctness checking in NonZero challenge. I will create a separate challenge for it.
    I don't add more functions to existing challenge to keep each challenge under manageable size. I will create other challenges for functions inside the same modules as the existing ones.
  • Close linked-list challenge

Resolves #ISSUE-NUMBER

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

@thanhnguyen-aws thanhnguyen-aws requested a review from a team as a code owner February 17, 2025 18:11
Copy link

@carolynzech carolynzech left a comment

Choose a reason for hiding this comment

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

I haven't reviewed the harnesses in-depth yet; focused on the contracts and other changes for now.

Comment on lines +1192 to +1193
#[ensures(|_|
ub_checks::can_dereference(crate::ptr::slice_from_raw_parts(self.as_ptr() as *const u8, count * size_of::<T>())))]

Choose a reason for hiding this comment

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

Not sure about this ensures clause... what's the rationale?

Copy link
Author

Choose a reason for hiding this comment

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

I copied it from the write_bytes function in intrinsics::mode.rs. The write_bytes of NonNull just calls that function.

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