r/rust • u/rustacean1337 • Nov 17 '22
What are Rust’s biggest weaknesses?
What would you say are Rust’s biggest weaknesses right now? And are they things that can be fixed in future versions do you think or is it something that could only be fixed by introducing a breaking change? Let’s say if you could create a Rust 2.0 and therefore not worry about backwards compatibility what would you do different.
220
Upvotes
View all comments
Show parent comment
2
u/BigPeteB Nov 18 '22
Generally yes, but aren't there corner cases where it could still insert padding? I think in C that's true (although unlikely, but nevertheless makes it unreliable for writing portable code); I'm unclear if Rust has the same problem. It also forces you to declare a field for any padding, which must have a unique name and must then be assigned a value, whereas I'd rather be able to just say what the offset or alignment should be and have the padding be handled invisibly. The
bitfieldcrate gives you that ability, but then you're stuck working with alignment in bits rather than bytes.