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

Fix panics in try_cast_slice_box etc #254

Merged
merged 2 commits into from
Jul 21, 2024

Conversation

zachs18
Copy link
Contributor

@zachs18 zachs18 commented Jul 21, 2024

Addresses the panics described in #253, but does not change the other inconsistencies (i.e. option 1 overall "status quo" + option 1 for the panic "Allow empty source slices for [NonZst] -> [Zst], return an error on non-empty source slices").

Casting from non-empty non-ZST slices to ZST slices now returns Err(SizeMismatch) (instead of panicking).
Casting from empty non-ZST slices to ZST slices is allowed and returns an empty slice (instead of panicking).
Casting from ZST slices to non-ZST slices is allowed and returns an empty slice (status quo).
Copy link
Owner

@Lokathor Lokathor left a comment

Choose a reason for hiding this comment

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

Regardless of what we decide in 253, we definitely want to remove these panic possibilities.

@Lokathor Lokathor merged commit 005ee32 into Lokathor:main Jul 21, 2024
14 checks passed
@Lokathor Lokathor added the semver-patch semver patch change label Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch semver patch change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants