by writebetterc · 1y ago · 0 comments
Anyway, my conclusion is that in order to learn Rust you can't use any syntactic sugar the language provides, those are 'expert features'. There's no way I'd be able to figure out why this happens. Do rust-analyzer provide a way of desugaring these constructs?
This is the common case in languages with sugar.
Heck, you could consider all of Rust sugar for MIR...
> There's no way I'd be able to figure out why this happens.
You don't generally need to, but most of this is documented:
https://doc.rust-lang.org/stable/std/iter/index.html#for-loo...
https://doc.rust-lang.org/stable/std/ops/trait.Add.html#impl...
?'s desugaring isn't documented because the desugaring is subject to change.