Make the Debug
implementation for union
s always opaque
#4118
Labels
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-help-wanted
Call for participation: Help is requested to fix this issue.
We currently have a lot of
unsafe
reads of unions fields which is source of easy unsoundness. Let's make things easier while avoiding this completely:s_no_extra_traits
to do an opaqueDebug
implementation on unions, herelibc/src/macros.rs
Lines 122 to 129 in 2f931d9
Debug
implementations on unions (which will now conflict).The implementation is easy, this will just print the types as
some_union { .. }
:We can backport this to
libc-0.2
since it fixes some soundness issues without breaking any API.The text was updated successfully, but these errors were encountered: