Why are Rust programs slow to compile?

210 points Speykious

This is one of the main downsides of Rust, compared to other languages.

Upon searching, I found an answer in the FAQ of the previous website.

I got curious about a few things, notably that MIR thing that seemed to be a work in progress... But when I checked, it seems that MIR has been in use for years already, unless I missed something out. So I'm not sure how outdated the reasons I found on the old website are. Do you know the reasons why Rust has slow compilation times today?

By that I mean that I want to find a resource that would tell me roughly what rustc does (maybe cargo too?) when compiling, what takes the most time and why, without having to read the entire code of the compiler - if anything, I might dive into some of the compiler code based on that resource out of curiosity if you see what I mean.

EDIT: I realize that I forgot a crucial part of my question, and it's debug vs release mode. For the most part, I care about debug mode build times because this is where developers want results quickly at the price of fewer optimizations. In release mode, if it takes 10 times more time to compile, it's ok to me. And thanks to people in this post I found the cg_clif project which I might dive into later (I'd heard about cranelift before but only vaguely).