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

Disallow casting ZST <-> non-ZST in cast_slice_box. #255

Closed

Conversation

zachs18
Copy link
Contributor

@zachs18 zachs18 commented Jul 21, 2024

Alternative to #254. Fixes the panics in try_cast_slice_box by disallowing casting between boxed ZST slices and boxed non-ZST slices, regardless of length (i.e. option 3 from #253 "Make cast_slice_box behave like cast_slice").

Casting between non-ZST slices and ZST slices now returns Err(SizeMismatch) (instead of panicking).
@Lokathor
Copy link
Owner

I merged 254 instead of this because i think that we should always be trying to move towards more casts allowed than less. That said, I won't actually publish the patch right away, I'd like to think on 253 a bit more and then resolve that fully and then do a release with a "complete" solution.

@Lokathor Lokathor closed this Jul 21, 2024
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