Contrary to my rfc, I think I have been persuaded that unions should be structs, not enums. The primary distinction between an enum and a...
-
-
@BRIAN_____ heh, well that's what I mean about data being defined by access patterns, not storageThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@BRIAN_____ we already have different reprs for structs (C, packed), why not union too? -
@nick_r_cameron@BRIAN_____ #[repr(C)] is not *that* different from the default. It doesn’t change semantics of the thing. -
@SimonSapin@BRIAN_____ it changes the offsets of the fields, just like union would. repr(packed) changes static semantics too... -
@nick_r_cameron@SimonSapin@BRIAN_____ call union `repr(REALLY_packed)`
End of conversation
New conversation -
-
-
@nick_r_cameron The question is, does it help end-users to have unions be a special kind of struct/enum rather than its own thing. IMO, no. -
@BRIAN_____ I don't think it harms them either, and helps discourage use. Unions are intended only to make C interop easier -
@nick_r_cameron#include <header.h> is the ultimate solution to C interop, IMO. C++ is probably too complex for that. -
@nick_r_cameron That I have to manually keep the Rust #[repr(C)] declaration of a struct in sync with the original definition is madness. -
@BRIAN_____ This can (and should) be automated using bindgen. If this is not ergonomic we should fix the tools.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.