How much syntax sugar has Rust?

Is there a way to let the compiler show me what it does? i.e. show me the de-sugered version of my code?

It will be super helpful as a learning tool.

1 Like

I've a few idea about how could this be like, e.g. a for loop going to be an if and goto etc.

A for loop is equivalent to IntoIterator::into_iter followed by a loop and match, as shown in the std::iter docs.

1 Like

Oh, I didn't know about that. Thanks :slight_smile: