-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Implement TransparentWrapper for [T; 1]
, (T,)
, and (T, ())
#264
Conversation
b54038f
to
d3f1839
Compare
while reading the help doc to verify |
Other than |
IIRC tuples do not have a defined layout (they are implicitly
Even if the |
I think I'm having a hard time wrapping my head around what what repr(rust) actually guaranteed. Re-reading it again I think I get it now that it only talks about alignment not size, so
I think I misread that part as requiring they have the same alignment and size. |
So, when I reviewed the exact unsafe contract for Since all previous usage of |
d3f1839
to
76791a7
Compare
76791a7
to
292eace
Compare
The requirements are that which is required for soundness:
|
ok I'll just close this then, looks like what I was trying to remove unsafe from might not be safe then? Is this something miri don't catch? I changed the commit if you do want the |
In your specific context it might be safe, depending on how much that situation was assuming. If you've got a link to some code you can post about it in the |
I think this is why I got confused about what it exactly wanted. I thought #1 was just saying " |
When attempting to remove some unsafe code I came across the limitation that
TransparentWrapper<T>
isn't implemented for(T, ())
. I added the other two since they also make sense and I don't see a downside.