-
Notifications
You must be signed in to change notification settings - Fork 1
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
Investigate ZST-slices #5
Comments
It should be
For a ZST we can no longer assume that the length is |
Interesting, the compiler does not like it though: play |
Conjuring the slice of such a length from
|
Oh, using a
|
This leaves open the question whether the new slice is allowed to point to |
Even if memory safe, concatenating ZST slices is outright weird.
Meaning, even if we were to restrict concatenating ZST slices to |
As pointed out to me in this thread it may be invalid to create references to an uninhabited ZST. In that case, we must ensure not to create a slice of length |
Arrays, vectors and slices have special handling of ZSTs. For example a Vec of ZSTs always points to |
Iirc, allocated slices (vec and boxed, etc.) will point to |
This question got answered: rust-lang/unsafe-code-guidelines#168 (comment)
According to the definition of aliasing rules and because shared references are |
How does
concat_slice(&[(); isize::max_value()][..], &[(); isize::max_value()][..])
work? How should it be handled? We should add a comment somewhere once we know what it does / have decided on what to do.@HeroicKatora
The text was updated successfully, but these errors were encountered: