r/rust • • 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

390 comments sorted by

View all comments

Show parent comment

2

u/rosefromthedead_ Nov 18 '22

That's a valid ergonomic complaint, but I think what you want is possible with repr(packed), if not comfortable. Specifically, it seems that padding will never be inserted. From the nomicon:

repr(packed) forces Rust to strip any padding, and only align the type to a byte.

For some reason though, it doesn't seem to be possible to specify alignment (at least by using repr(align(n))) on a packed type.