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

add specific tests for copy_match #188

Merged
merged 1 commit into from
Sep 19, 2024
Merged

add specific tests for copy_match #188

merged 1 commit into from
Sep 19, 2024

Conversation

folkertdev
Copy link
Collaborator

No description provided.

@folkertdev folkertdev merged commit 0e95888 into main Sep 19, 2024
18 checks passed
@folkertdev folkertdev deleted the copy-match-tests branch September 19, 2024 12:06
Comment on lines +179 to +181
let ptr = buf.as_mut_ptr();
unsafe {
Self::copy_chunk_unchecked::<C>(
buf.as_ptr().add(start),
buf.as_mut_ptr().add(current),
buf.as_ptr().add(end),
)
Self::copy_chunk_unchecked::<C>(ptr.add(start), ptr.add(current), ptr.add(end))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is against miri rules to use the as_ptr to read from something modified by the as_mut_ptr. This is easily fixed by basing all pointers off of the mutable pointer. Because of subtyping, the mut is degrated to const when the type signatures demand it.

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.

1 participant