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

17

u/[deleted] Nov 17 '22

[removed] — view removed comment

2

u/matthieum [he/him] Nov 18 '22

The problem is not the struct, it's the algorithms written (in unsafe code) which assume that for any struct size_of == stride_of (because that's the statu-quo).

Your opt-in repr wouldn't fix those algorithms, and wouldn't fix the C code to which Rust structs/arrays are passed and which assumes the same.

I don't think it solves the problem.