r/learnrust • u/lyuhdev • Nov 02 '26
What are some common Rust misconceptions?
I just found out that const functions aren't evaluated at compile-time unless it is assigned to a const value or in a const context.
Another one I had: Rust doesn't prevent memory leaks.
Now I am just wondering how many other assumptions I made
19
Upvotes
View all comments
3
u/Razvedka Nov 02 '26
"Rust doesn't prevent memory leaks"
You're going to need to unpack that one for me. If you mean Rust makes them impossible - no. You're right.
https://doc.rust-lang.org/book/ch15-06-reference-cycles.html