-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Vec<!> should be ZST #51524
Comments
It's not only |
Can this useless ballast be optimized away? Maybe there can be some |
It could in theory be optimized away through specialization, but what's the actual value of doing that? In what context are you working with enough |
Like with other degenerate cases, probably when code is generated by macros or some other means and relies on heavy optimizer to remove the most of it and retain the meaningful part. |
See also #45431. |
It seems like this is too esoteric and doesn't actually have a concrete use case for us to track, as well as being not entirely clear to me that this is true. Any wins here are likely to be equivalent to #45431 as cited by cuviper. |
Expected:
0 0 18446744073709551615
Actual:
0 24 18446744073709551615
Length field is irrelevant, as the vector can be only empty.
capacity()
getter does not work for ZST anyway, so capacity field is irrelevant too.Obviously, HashMap and other data structures should collapse to ZST as well when facing the
!
.The text was updated successfully, but these errors were encountered: