r/ProgrammingLanguages • u/jamiiecb • Apr 10 '26
Borrow-checking surprises
https://www.scattered-thoughts.net/writing/borrow-checking-surprises
52
Upvotes
r/ProgrammingLanguages • u/jamiiecb • Apr 10 '26
View all comments
9
u/joonazan Apr 10 '26
This is what I hate about Rust. You need to learn what you are allowed to do but then actually doing it can be trial and error even for long-time professional users.
The different rules that govern inline code and functions create friction all the time because you want to be able to extract code into a function but in Rust you can't always do that. Especially self-reference is tolerated in code blocks but not in structs.
In type-level programming it isn't even always clear what is allowed and sometimes what is allowed by the language breaks the compiler.